Jump to content

Javascript conflicting with .htaccess


reversenorm

Recommended Posts

Okay so here's the problem. We have recently implemented a select box to allow users to navigate to different categories on our site. This part works fine but in IE6 the select box window always stays on top, and interferes with our menus.

 

The next thing that I did was implement a javascript workaround for this issue. it can be found here

 

http://www.brainfault.com/2008/02/10/new-release-of-jquery-selectbox-replacement/

here's and example page

http://www.brainfault.com/demo/selectbox/0.5/

 

  On the site I'm working on we modified our .htaccess to change a truncated url to the full get url so that the website can be crawled. Here's and excerpt from the .htaccess file

 

...

RewriteRule ^view/([0-9]+)$ view/$1/ [R]

RewriteRule ^view/([0-9]+)/$ view.php?category=$1

...

 

basically what this does is tell the server to change links that look like this

 

http://www.example.com/view/13/

to this

http://www.example.com/view.php?category=13

 

The problem arises because the selectbox javascript (or maybe it's jquery I don't know) appears to look to the displayed url rather than the parsed url, so it doesn't load the new select box.

 

Any clues or solutions would be great.

 

 

Link to comment
Share on other sites

Well sort of,

 

I agree the issue seems to be in the method of the option box; however I've tried changing the html to use either post or get and both methods work. The problem seems to reside somewhere in the javascript. The php script gets it's variables defined by using the $_REQUEST command so it doesn't care if we use get or post. Then those php defined variables are used in creating the plain option box, then the javascript should read the option box and build the new box that stays on the right layer in IE and for some reason it only does this if the URL is using the full "get" style url rather than some other form that we defined through the .htaccess. Myabe it's something dumb like the javascript needs to be at the bottom of the page to make sure the variables have been properly defined...

 

Still any additional suggestions would be great.

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.