/    Sign up×
Community /Pin to ProfileBookmark

Problems with first run

Hi guys I have this problem now for 1 week and I can not figure it out.

I created this script in “Ajax” the problem is that the first time I open the browser (Firefox 5.0) and I make the request, the print function does not start, I work from the second request then why?

This is the function that invokes printing:

[CODE]

myHandler7 function () {
if (myRequest.readyState == 4 & & myRequest.status == 200) {
release ();
else {}
e = document.getElementById (“calcolatrice_quantita”);
e.innerHTML = ‘<IMG src=”../immagini/v3_loading.gif” style=”position:absolute; top:150px;left:500px”>’;
}
}
[/CODE]

This is the print function:

[CODE]

myHandler8 function () {
if (myRequest.readyState == 4 & & myRequest.status == 200) {

else {}
e.innerHTML = ‘<IMG src=”../immagini/v3_loading.gif” style=”position:absolute; top:150px;left:500px”>’;
}
}

function print () {
myRequest CreateXmlHttpReq2 = (myHandler8);
myRequest.open (“GET”, “stampa.php”);
myRequest.send (null);
}
[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@DanInMASep 01.2011 — you should defintely rename your function as "print" is a reserved namespace as it is an internal JS event already. Also in the function "print" you have now, you have not added a print event ( event or function I'm not sure what the proper term is for this one)
×

Success!

Help @m_manzari spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...