/    Sign up×
Community /Pin to ProfileBookmark

Hi all i have javascript function _dopostback on my page i need it to fire on page load so i put it in <body onload:> it kinda works the way i want but trouble is it keeps firing and the page continually reloads.

Is there anyway i can get it to fire once when the page loads?

Thanks

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@ZeroKilledMar 26.2009 — can you post a link so any of us can check the script?
Copy linkTweet thisAlerts:
@rbrownauthorMar 26.2009 — the page im editing is this:

https://bookings.palace-cinema.com/

on page load though im trying to use javascript to automatically click the small palace cinema link in the middle of page.

so you can view the movie list which you get when you click the link normally.

this works when you add the _dopostback function [I](which you can see when you hover over the link on the page)[/I] in the body tag as onload but like i said it keeps reloading. and i just need it once.

maybe you have another solution?? but this is the closest i have been so far to what i want.
Copy linkTweet thisAlerts:
@ZeroKilledMar 27.2009 — i can't think of a clever idea. problem is that javascript can't determine if the current page is the result of a submitted page unless you specify it somehow. was thinking on the idea that on loading you check the existence of some html element to determine if __doPostBack should be called. however, i noticed that while you advance in the application, it keep generating the document in the same URL, and of course, with different content which probably would be more harder the solution in javascript.

however, because you are working with dynamic content in the server, maybe you can dynamically remove or add the __doPostBack function to onload. but it don't make sense to me, in the first place why you wouldn't display the content as if the link were pressed? on my opinion, is a waste because after all you want the user to view a fixed options. also, you are doing double request to server: first time user visit page, and second time which is the result of __doPostBack on previous page.
×

Success!

Help @rbrown 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.3,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...