homepage Welcome to WebmasterWorld Guest from 54.205.144.54
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
Hitesh




msg:1482799
 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);
sendToUrl(url);
}

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?

 

korkus2000




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

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

var url;

Hitesh




msg:1482801
 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.

korkus2000




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

Like this:

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

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.

Hitesh




msg:1482803
 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