Page 1 of 1

Help with php and jQuery

Posted: Mon Dec 13, 2010 9:18 am
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

Re: Help with php and jQuery

Posted: Mon Dec 13, 2010 9:49 am
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.