Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Ajax - Load Content After Every Minute!
Old 10-31-2009, 07:17 AM Ajax - Load Content After Every Minute!
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
Can anyone help me or tell me how to send an ajax request upon a live time change for example

15:15 - Load Content
15:16 - Load Content
15:17 - Load Content

ect...

Is this possible?
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
 
Register now for full access!
Old 10-31-2009, 07:33 AM Re: Ajax - Load Content After Every Minute!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It is but you would probably crash the browsers after a few iterations.

A JAVA applet would be a better method, with that you could update every few seconds without draining resources.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-31-2009, 07:45 AM Re: Ajax - Load Content After Every Minute!
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
do you think it would crash if i used window.SetInterval(functio, time); I only need it to load a string of text etc.
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 10-31-2009, 08:12 AM Re: Ajax - Load Content After Every Minute!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's not what you load but how! Each iteration will which take up a bit of memory, try leaving Gmail (AJAX version) open for a while and see how the memory usage goes up.

Also IE locks the XMLhttp object so you have to do a bit of hoop jumping to make it fully cross browser functional, even ver8 seemingly, when I tested it a few months ago. (I use AJAX in a application backend that needs to make several server calls)
http://keelypavan.blogspot.com/2006/...ect-in-ie.html

http://www.webmaster-talk.com/javasc...ow-i-hate.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-31-2009, 08:23 AM Re: Ajax - Load Content After Every Minute!
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
would this work

Code:
//Submit Data
function submitData(pageId, data, type) {
type = typeof(type) != 'undefined' ? type : 'GET';
//passedData = typeof(passedData) != 'undefined' ? passedData : '';
$(document).ready(function()
{
    message();
    $.ajax({
    type: type,
    data: data+'&pageId='+pageId,
    url: 'ajax/includes/content.php',
    cache: false,
    success: function(data){
     $('#content_holder').html(data);
     remove_message();
    }
    });
});
return false;
}
Run this on a timer???
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 10-31-2009, 09:49 AM Re: Ajax - Load Content After Every Minute!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
haven't a clue.

I assume you are using some kind of "framework"?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-31-2009, 09:56 AM Re: Ajax - Load Content After Every Minute!
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
yup, jquery!
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
Old 10-31-2009, 10:05 AM Re: Ajax - Load Content After Every Minute!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Ok! I don't use any of them so I have no idea of the syntax.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Ajax - Load Content After Every Minute!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28347 seconds with 12 queries