Help with php and jQuery

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jankidudel
Forum Commoner
Posts: 91
Joined: Sat Oct 16, 2010 4:30 pm
Location: Lithuania, Vilnius

Help with php and jQuery

Post by jankidudel »

Hi, i appreciate you if you help me

Code: Select all

<html>
  <head>
    <script src=' jquery.js' ></script>
 </head>
<body>
<?php
$file_contents = file_get_contents('http://www.mail.ru' );  // get contents of some file

// and now i must to remove all divs which haven't class=' logo'  
// before showing the page to the visitor

<script>
  $(".logo" ).remove();   // but this will remove exactly logo, non the other divs
</script>
// and 2 problem is how to do jquery remove before showing contents of a page ?
print $file_contents
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Help with php and jQuery

Post by pickle »

It might be easier if you use jQuery to do an ajax call to load the file contents - then it's already in Javascript & you can easily modify/remove sections.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply