Jump to content

Combining jQuery with PHP


Miko

Recommended Posts

Hi there! :)

 

I'm trying to combine some PHP code in my jQuery:

I have this code here:

 

$('#selectDepot').append("<?php echo "<ul>"; foreach($fetchdepot as $depot){$depotNr = $depot['depots']; echo "<li><a href='\"#\"'>".$depotNr."</a></li>";} echo "</ul>"; ?>");

 

As you can see my php code will get some info and echo it out as a hyperlink.

The strange thing is that when I remove the hyperlink the data is printed out correctly, but when I add the hyperlink (a href="") well, it just disappears.

 

Anyone can help me out here?

 

Thanks! :)

Link to comment
https://forums.phpfreaks.com/topic/183548-combining-jquery-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.