Gossamer Forum
Home : Products : DBMan : Customization :

Delimiter and javascript probs.. help

Quote Reply
Delimiter and javascript probs.. help
I use the short/long method of displaying results.. I found this javascript to open a new window the exact size of an image.. the problem being, it generates an error cause it includes the "|" which is my delimiter.. I dont want to change my delimiter so does anyone have an ideas..

I know you guys are going to say this should be in some sorta javascript forum but I take my chances.. someone might know.. then I can finish the site...

The part of the script is.. if(sWidth!=ix || sHeight!=iy)

Id really appreciate any help.. Justin



Quote Reply
Re: Delimiter and javascript probs.. help In reply to
Im not sure how the code you provided relates to the problem you described but I didn't really understand what you were saying - anyway, it may help to escape the pipe.....like....

\|

Or if I am understanding correctly, try.....

if(sWidth!=ix or sHeight!=iy)

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Delimiter and javascript probs.. help In reply to
Your html code is placed between an opening qq| and a closing |;. This is what's causing the problem in the javascript when it hits the "|". Right before the javascript begins, close off your html statement with a |; then use qq~ and ~; to enclose your javascript statement then open up the next html statement with qq| again.



Melanie
http://www.somemoorecats.com/ww/
http://www.okhima.org/
Quote Reply
Re: Delimiter and javascript probs.. help In reply to
Or you can or what I suggested Wink

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Delimiter and javascript probs.. help In reply to
Thanks for your input.. I´ve tried Pauls way, but the javascript does not work.. and I´m not sure how to go abouts what Melanie suggested.. I enclose a link to the sub html_page_top where I´m having the problems.. So if you can suggest alternatives I would be greatfull..

http://www.visaverde.com/gossamer-threads.txt

One thing I noticed however is that if I completely remove this bit of code it works.. but I´m not sure if this will have any consequences..

if(sWidth!=ix || sHeight!=iy) {
win.close();
setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
return;
}


Thanks for your help in advance.. Justin


Quote Reply
Re: Delimiter and javascript probs.. help In reply to
Oh right I see what you mean now sorry....

Yes msmoore was correct - surround the html/javascript using qq~ ~; instead of qq| |;

Paul Wilson.
Installations:
http://www.wiredon.net/gt/
Quote Reply
Re: Delimiter and javascript probs.. help In reply to
***lol, nevermind, I believe you figured out what Melanie was talking about, while I was typing this****

I believe what Melanie is suggesting is:

at the top of the subroutine after &html_print_headers;

replace
Code:
print qq|
with
Code:
print qq~
and at the bottom of the subroutine:

just before the closing }

replace
Code:
|;
with
Code:
~;
Trev

Quote Reply
Re: Delimiter and javascript probs.. help In reply to
Fantastic.. thanks you guys.. if I could, I´d organise a beer for everyone..