473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

javascript/html popup crash firefox?

Hi,

I'm having some trouble implementing a popup in firefox. I attached some
simplified code at the bottom. This is part of a firefox extension. What
happens is that a popup window is created, the popup window updates it's
data depending on what is shown on the main window. The problem comes when i
click the 'X' to close the popup window. it crashes firefox, and closes all
firefox windows. can somebody help me with this? why does this happen? I'm
99% sure the error comes from the form in the html code.

thanks! for any help.
window.getNode = function (t)
{//stuff}

window.printNode = function (node)
{//stuff}

window.updateWindow = function (num, tag, inner) {
outputWindow.document.outputForm.nodeNum.value = num;
outputWindow.document.outputForm.nodeTag.value = tag;
outputWindow.document.outputForm.innerHTML.value = inner;
}

//popup
window.outputWindow = window.open('', 'outwindow', 'width=500,height=500');

//add contents to window
outputWindow.document.write("<html><body><form name='outputForm'>Node
number:<input type=text size=20 name='nodeNum' value=''><br>Node tag:<input
type=text size=10 name='nodeTag' value=''><br>Inner HTML:<input type=text
size=50 name='innerHTML' value=''></form></body></html>");

document.onmouseover = getNode;
Jul 28 '05 #1
3 2239
Alex wrote:
Hi, [...] //add contents to window
outputWindow.document.write("<html><body><form name='outputForm'>Node
number:<input type=text size=20 name='nodeNum' value=''><br>Node tag:<input
type=text size=10 name='nodeTag' value=''><br>Inner HTML:<input type=text
size=50 name='innerHTML' value=''></form></body></html>");


outputWindow.document.close();
You can make the huge line above a bit more manageable:

outputWindow.document.write(
"<html><body><form name='outputForm'>Node number:",
"<input type=text size=20 name='nodeNum' value=''>",
"<br>Node tag:<input type=text size=10 name='nodeTag' value=''>",
"<br>Inner HTML:<input type=text> size=50 name='innerHTML'",
" value=''></form></body></html>"
);
Untested.

....

--
Rob
Jul 28 '05 #2

"RobG" <rg***@iinet.net.auau> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
Alex wrote:
Hi,

[...]
//add contents to window
outputWindow.document.write("<html><body><form name='outputForm'>Node
number:<input type=text size=20 name='nodeNum' value=''><br>Node
tag:<input type=text size=10 name='nodeTag' value=''><br>Inner
HTML:<input type=text size=50 name='innerHTML'
value=''></form></body></html>");


outputWindow.document.close();


i didn't have a chance to try it yet, but wouldn't the line above close the
window as soon as it's created? i want the popup to keep change it's data
until the user closes the popup. i'll try it.

thanks.
Jul 28 '05 #3
Alex wrote:
"RobG" <rg***@iinet.net.auau> wrote in message
news:42**********************@per-qv1-newsreader-01.iinet.net.au...
Alex wrote:
Hi,


[...]
//add contents to window
outputWindow.document.write("<html><body><for m name='outputForm'>Node
number:<input type=text size=20 name='nodeNum' value=''><br>Node
tag:<input type=text size=10 name='nodeTag' value=''><br>Inner
HTML:<input type=text size=50 name='innerHTML'
value=''></form></body></html>");


outputWindow.document.close();

i didn't have a chance to try it yet, but wouldn't the line above close the
window as soon as it's created? i want the popup to keep change it's data
until the user closes the popup. i'll try it.


It closes the document, not the window. It effectively tells the browser
'I've finished writing now'.
<input type="button" value="openWindow" onclick="

window.outputWindow =
window.open('', 'outwindow', 'width=500,height=500');

outputWindow.document.write(
'<html><body><form name=\'outputForm\'>Node number:',
'<input type=text size=20 name=\'nodeNum\' value=\'\'>',
'<br>Node tag:<input type=text size=10 name=\'nodeTag\'',
'value=\'\'><br>Inner HTML:<input type=text size=50 ',
'name=\'innerHTML\' value=\'\'></form></body></html>'
);
outputWindow.document.close();
">


--
Rob
Jul 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Bokma | last post by:
I have two windows in a frame. I want to be able that each can open a pop up window and that the handle to that window can be stored somewhere, so that each can talk to the pop up. is it...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
9
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with...
4
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
4
by: mr.fullzero | last post by:
Our team have extracted code sample that caused abnormal Safari termination. The crash seems to happen any time, when user selects an option and closes alert popup. The version of Safari is 10.4.6....
4
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a...
3
by: stevenc417 | last post by:
The popup works fine on Firefox 1.5.0.9, but it doesn't work on IE7. It just re-acts like a regular link on IE7. Any ideas anyone? Thanks, Steven ...
1
by: prash.marne | last post by:
Hi, I am trying open a simple popup window & my code is .. <html> <head> <title>popup_window</title> <script type="text/javascript"> function popup_onclick(){ my_window =...
16
by: Eric | last post by:
I have a user of a web application written in Java/JSP that is unable to login to the site simply because certain links on the page do not run when they are clicked. Other popups using Javascript...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.