Topic: Why is my document found to be null? Pages that link to <a href="https://ozoneasylum.com/backlink?for=30417" title="Pages that link to Topic: Why is my document found to be null?" rel="nofollow" >Topic: Why is my document found to be null?\

 
Author Thread
ruffy
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2008

IP logged posted posted 07-15-2008 00:46 Edit Quote

I want to display data retrieved by ajax.
For starters, I just echo back from php a number.
Javascript, however, finds my document (in bold below) to be null.
Curiously, this code elsewhere in my script
works just fine.
Can you maybe see where in my code below I've erred?


function grabItemHist() {
http = getHTTPObject();
var item = document.getElementById("itemid").value;
url = "ajaxGrabItemHist.php?itemid=" + item;
http.open("GET", url, true);
http.onreadystatechange = showItemHist;
http.send(null);
}

function showItemHist() {
if (http.readyState == 4) {
var results = http.responseText;
itemWin=window.open('','itemscr','height=300,width=350');
var tmp = itemWin.document;
tmp.write('<html><head><title>Item History</title></head>');
tmp.write('<body><p>Items:</p>');
tmp.write('<p>Found this many items: '+results+'</p>');
tmp.write('</body></html>');
tmp.close();
if (window.focus) {itemWin.focus()}
}
}

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 07-15-2008 09:00 Edit Quote

Does the window/tab even open ? It could simply be blocked by the browser.

ruffy
Nervous Wreck (II) Inmate

From:
Insane since: Jun 2008

IP logged posted posted 07-16-2008 00:28 Edit Quote

Poi, the same code, with different names, works just fine elsewhere in the script.
So blockage wouldn't be the issue.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

IP logged posted posted 07-16-2008 02:42 Edit Quote
quote:

ruffy said:

Poi, the same code, with different names, works just fine elsewhere in the script.



Then if the code you posted isn't the issue, it is where and / or how it's being called right? If it works one place and not the other, what is the difference between the two?

Later,

C:\



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu