Jump to content

javascript and php....don't like each other?


pgsjoe

Recommended Posts

so I pulled some script off of DynamicDrive.com and used it on a regular HTML page and it worked awesome. But, once I tried to incorporate PHP into it, all of the sudden "it don't work so good". The script is suppose to float the menu on the page, and as you scroll down, it moves with you. And again it works fine on the regular page, so I'm almost positive it's not the javascript that's messed up.

The box is taking on the CSS attributes (which it should) and parsing the correct information, as well as the rest of the page looking as it should, but the box doesn't float. I know there's a difference between client-side and server-side coding, but I really don't know what to do here. if you know anything, thanks in advance.

So for some reason it won't let me post the code up...keeps giving me a "page cannot be displayed" error. So here's a link to a text version of the code. I've marked off the code that's not working with dashed lines.

http://www.asse.org/gau/help.php

and, if you need to see it. that's here... http://www.asse.org/gau/gauform.php

thank you again in advance. this one is killing me!

Link to comment
Share on other sites

If this is the script you tried to implement, http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm then I wouldnt' use it altogether.  Not only could I not get it to work on my PHP site but when I went to the aforementioned dynamicdrive site, the menu disappeared and wouldn't come back after scrolling up and down a few times.
Link to comment
Share on other sites

well I wasn't printing/echoing the script using PHP. I was closing out the PHP tags, entering in the javascript, opening the php tags in the editable region of the code, closing the php tags out and going back into the javascript.

is there something special that has to be done to it? do I have to print the code through PHP?

as for it not working at all, I've been using it for a while on a regular HTML page and it's been holding up okay.
Link to comment
Share on other sites

well that's why I know it's not a javascript problem, the script works fine. So I posted it in the PHP help area because I think it's just the way the php is arranged within the script. I just close out the php ?> put the script in, cut into the middle of the script with php <? database retrieval of information ?> then back into the javascript.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.