homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Search Function works in IE5.5 but not in Mozilla

 7:37 pm on Aug 27, 2003 (gmt 0)

My team created a page where they could search images or pages using keywords and parameters. The search function was developed within house. I am a newcomer to this project. I have to figure out why it doesn't work with Netscape or Mozilla but in IE 5.5. I don't think it had to do with HTML coding or standards but the way linking is set up.

Here is a portion of the javascript code:

url = "{{sub_prefix}}/servlet/DisplayServlet? url=srchByKeywordURL&search=search2&whereClause=" + escape(whereClause);

This works for IE. I do not know what the code is saying but I know by intuition and guts that this above portion is why it won't work with Mozilla. Can anyone care to explain to me?



 7:44 pm on Aug 27, 2003 (gmt 0)

That part seems OK. Did you declare url? Like:

var url;


 8:04 pm on Aug 27, 2003 (gmt 0)

No I didn't. Where should I put it? outside the Javascript code or outside the function or within the function code?

why do you think this may be the reason? I am just curious.


 11:57 pm on Aug 27, 2003 (gmt 0)

Like this:

var url = "{{sub_prefix}}/servlet/DisplayServlet?url=srchByKeywordURL&search=search2&whereClause=" + escape(whereClause);

Just that some javascript parsers require variable declaration, just as some require semicolons at the end of statements. It is a long shot that this is the problem, but it seems to be the only problem I could find with the code.


 2:38 pm on Aug 28, 2003 (gmt 0)

I figured out. It wasn't the code I posted, go figure. It was the declarion of form and the use of form in methods.

For example, you would normally write in HTML:

document.searchForm.blah.blah or document.searchForm.blah

In the javascript code, the above code was included except for the word, "document". Strangley this omission doesn't affect IE but it affected Mozilla. So in the javascript code, i added the word, "document." to every formname, "searchForm".

I hope it is clear to you. Sorry for all the trouble.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved