Page 1 of 1

passing php values into java script

Posted: Wed Jul 04, 2007 9:26 am
by sarbas
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi Folks,

               I am using follwing google map script. I want to pass my php values into this script. I want to pass php values into  [b] "City, State, Country",[/b] this line. Can anyone help me? 

[syntax="javascript"]<script type="text/javascript">
    function LoadMapSearchControl() {

      var options = {
            zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
            title : "Complex",
            url : "http://www.google.com/corporate/index.html",
            idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM-2,
            activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM-2
            }

      new GSmapSearchControl(
            document.getElementById("mapsearch"),
           [b] "City, State, Country",[/b]
            options
            );

    }
    // arrange for this function to be called during body.onload
    // event processing
    GSearch.setOnLoadCallback(LoadMapSearchControl);
  </script>
Regards


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Jul 04, 2007 9:29 am
by feyd
What have you tried?

Posted: Wed Jul 04, 2007 9:37 am
by sarbas
I tried with google.But i dont know about java script. thats why i posted here.

sorry feyd.
Next time onwards i'll follow rules and regulations to post the topic.

Regards

Posted: Wed Jul 04, 2007 9:48 am
by Jenk

Code: Select all

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

var someVar = '<?php echo $var; ?>';
alert(someVar);

</script>

Posted: Wed Jul 04, 2007 10:06 am
by sarbas
Thanks a lot Jenk.Its Working...

Keep Continue Your help...

Regards