Forum Moderators: coopster

Message Too Old, No Replies

Inserting .js to .php

How to insert javascripts to a php page?

         

capboyz

3:11 pm on Aug 8, 2007 (gmt 0)

10+ Year Member



I'm running osCommerce and i want to insert a javascript images slideshow to header.php

But i found javascript not working with the header.php as it doesn't contain <head>

So is there any way to make the slideshow to works? echo / insert? Urgently need help with this. Thanks

[edited by: coopster at 1:56 pm (utc) on Aug. 9, 2007]
[edit reason] removed url [/edit]

d40sithui

3:16 pm on Aug 8, 2007 (gmt 0)

10+ Year Member



u can insert js to any part of the page. just surround with <script> //js code here </script>

capboyz

4:25 pm on Aug 8, 2007 (gmt 0)

10+ Year Member



doesn't need to insert it to the <head> part?

d40sithui

5:33 pm on Aug 8, 2007 (gmt 0)

10+ Year Member



not really. thats where it typically goes, but JS will work too if its inside the <body> tags

try it, write something like this inside your <body>

<script>
alert("hello from body");
</script>