Jump to content

Passing PHP variables to jQuery?


rockinaway

Recommended Posts

PHP is server side, jQuery is client side.  There is no way to directly use the PHP variables in JavaScript.

 

Indirectly, you could do something like this:

<script type="text/javascript">
    var foo = "<?php echo $superSpecialVariable; ?>";
</script>

 

To assign client-side variables at run time.

 

~juddster

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.