Jump to content

Java/PHP


Cooper94

Recommended Posts

making Javascript (not java) and PHP talk to each other is somewhat difficult to understand. Since PHP is parsed on the server side, and javascript on the client side, the only way for these two languages to really talk to each other (based on my understanding. I could be wrong) is through post/get variables.

 

One thing you could do is make a hidden form, and set the value to some php value, and then use javascripts HTML DOM functions to get that value, IE

<!-- javascript
element=document.getElementById('hiddenfield').value;
mark1 = new GMarker(new GLatLng(openInfoWindowHtml(element), -75.240867), { icon: blueIcon});

 

and then you would just make the hidden form as such

 

<input type="hidden" value="<?php echo "myvalue"; ?>" />

 

I might have my syntax a little off, but the basic Idea is there. Hope that helps

Link to comment
https://forums.phpfreaks.com/topic/155736-javaphp/#findComment-819815
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.