Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Old February 21st, 2010, 04:24 AM
zed420 zed420 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Leeds, UK
Posts: 34 zed420 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 32 m 55 sec
Reputation Power: 6
Javascript - How to stop page refreshing constantly

Hi all
I have a very simple code to submit a form onLoad of a page, it works fine but IT keeps on refreshing every second, why ??? I really don't understand.
JS
Code:
function myfunc () {
	var form = document.getElementById("foo");
	form.submit();
	}

HTML
Code:
<body onload="myfunc()">
<form id="foo"  action="EventData" method="post" ></form>


Need some help please
Zed

Reply With Quote
Old February 21st, 2010, 02:35 PM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 2,293 IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 11 h 27 m 9 sec
Reputation Power: 10
well after the page loads it submits the form causing it to load again and after the page loads it submits the form causing it to load again and after the page loads it submits the form causing it to load again.....(break)

what are you trying to do? why would you need to submit the form on load?

Reply With Quote
Old February 21st, 2010, 03:00 PM
zed420 zed420 is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: Leeds, UK
Posts: 34 zed420 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 32 m 55 sec
Reputation Power: 6
Thanks for your significant input IAmALlama, What I am trying to do is , I have a index.jsp page that has to show some data from database, because it's the first page customer views it has to be onLoad so in order to fetch this data I'm trying to trigger a hidden form. All works well apart from like I said before, keeps on refreshing and refreshing and refreshing ... (No IAmALlama it doesn't take no break)

Quote:
Originally Posted by IAmALlama
well after the page loads it submits the form causing it to load again and after the page loads it submits the form causing it to load again and after the page loads it submits the form causing it to load again.....(break)

what are you trying to do? why would you need to submit the form on load?

Reply With Quote
Old February 22nd, 2010, 01:39 AM
IAmALlama IAmALlama is offline
Me
Click here for more information
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 2,293 IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level)IAmALlama User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 11 h 27 m 9 sec
Reputation Power: 10
the break was more of a programming joke, when inside a loop, you can call break to exit the most recent started loop. I was meaning it like I was caught in a loop and was break'ing out.

to help you out, we probably need to see some more code. Im still fuzzy about why you need to submit the form to pull from the database. why can't you just pull the data from the database whatever data you want without submitting the form?

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Javascript - How to stop page refreshing constantly


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap