Forum Moderators: open

Message Too Old, No Replies

script works offline but not online

         

jimmytango

2:53 am on Oct 29, 2004 (gmt 0)

10+ Year Member



i just cant seem to find the problem here. it works on my computer just fine but when i upload it to the web the script freezes the browser.

here is the script.

function buildPrintexample(exampleTitle, clientName, dateCreated, projectNotes, imageName, myImage) {
showcase.document.write("<html><head>")
showcase.document.write("<link rel=stylesheet type=text/css href=css.css>")
showcase.document.write("<script language=\"\javascript\"\ src=\"\javascript.js\"\></script>")
showcase.document.write("</head>")
showcase.document.write("<body background=\"images/home_111.jpg\" topmargin=10 leftmargin=0 bgproperties=fixed>")
showcase.document.write("<font class=big>" + exampleTitle + "</font><br>")
showcase.document.write("<font class=textdis>Client: " + clientName + "</font><br>")
showcase.document.write("<font class=textdis>Date:" + dateCreated + "</font><br>")
showcase.document.write("<font class=textdis>Click the image to see full version")
showcase.document.write("</font><br><br>")
showcase.document.write("<font class=text>Note:" + projectNotes + "</font><br>")
showcase.document.write("<center><a href=\"javascript:displayWindow('" + myImage + "');\">")
showcase.document.write("<img src=\"images/" + imageName + ".jpg\" border=0></a>")
showcase.document.write("</body></html>")
showcase.document.close();
}

function displayWindow(sPicURL){
window.open('showcase.html?'+sPicURL,'name','resizable=1, height=280, width=440');
}

is it because i am calling the displayWindow function from the build function? i don't know. the url is [palisadeindustries.com...] start clicking the links and you will see where the problem is.

thanx

kaled

9:45 am on Oct 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) If you need to use double quotes within a write, wrap the string in single quotes e.g. document.write(' "hello" ');
2) when writing the </ combination of chars always escape the slash thus '<\/'
3) I'm not sure why each document.write is prefixed by showcase. unless you are writing to one window from another - I've never tried that.

There may be other problems,

Kaled.

jimmytango

9:16 pm on Oct 31, 2004 (gmt 0)

10+ Year Member



i am writing from one window to another. everyting works fine until the link is clicked to open the new window. after that the browser stops functioning. nothing will fix this i don't know what it is.

jimmytango

1:35 am on Nov 5, 2004 (gmt 0)

10+ Year Member



nobody can help me with this?

jimmytango

1:56 am on Nov 5, 2004 (gmt 0)

10+ Year Member



nevermind...i kinda cheated my way out of the problem.

i just added a refresh action when the link was clicked and it fixed it.