I want a javascript code which will go through all the html file in my root folder and sub-folders and gets the content which are within a particular tag,
eg:
<div id="content">
!!this content!!
</div>
It should check for a comment at the top of html and only get the content if it exist.
<!–Allowed–>
It should only get if this is there. First of all is this possible? I wish jquery could do this!
Update:
Got enlightened that javascript is for client-side! So One last question, how does you use php to get the content that is within the a particular tag?
<div id="content">
!!this content!!
</div>
At first you have to get all the folders that are in the folder (on the server). That’s not possible with JavaScript alone. You have to write a PHP (or any other web-language supported on your webspace/server) which gives you the filename-list.
Then you can load each file with jQuery’s ajax-functions and test for your comment, etc.