473,657 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with dynamic content in Javascript/Ajax

10 New Member
Hi,
I am using AJAX to display dynamic RSS feeds in my web page.
So on page load i am callin the AJAX function Start_Timer() The body of Start_Timer() is as follows.

function Start_Timer()
{
getRSS(); //This is the function which gets the RSS feeds and displays it in a div tag in the page.
t=setTimeout("S tart_Timer()",6 000);
}

So according t this code every 6 seconds the function getRSS() should be called which updates the dynamic feed on the web page is it not?
But though the function is called every 6 seconds,it does not display the feed dynamically.Lik e for example if i delete the source feed,the script still displays the feed on the webpage and does not give an error.
Any idea what the problem is how do i rectify it? I would greatly appreciate any help.
Thanks
Satish
Apr 11 '07 #1
7 1876
iam_clint
1,208 Recognized Expert Top Contributor
try t=window.setTim eout("Start_Tim er()",6000);
Apr 11 '07 #2
satishr23
10 New Member
Hi,
Thanks for your reply. I tried that but it didnt work.In fact even if i try doing a simple document.write( "test") in the page in the function Start_Timer() ,it just executes it once instead of in a periodic manner.
Thanks again
Apr 11 '07 #3
iam_clint
1,208 Recognized Expert Top Contributor
var t=window.setTim eout("Start_Tim er()",6000);


let me see your other function
Apr 11 '07 #4
satishr23
10 New Member
Hi,
I was testing this application some more with different browsers and I find that it works fine in opera but gives problem(ie not updating dynamic feed) in IE and firefox. I am guessing it is due to some cache problem.
But in my script function I added a line

<CODE> ajaxobject.setR equestHeader("C ache-Control","no-cache") <CODE> where ajaxobject is my XMLHttpRequest( ) object

I thought this would make sure that the web page is updated everytime without using the cache.
Any ideas?
Thanks again
regds
Apr 11 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
You could try something like:
Expand|Select|Wrap|Line Numbers
  1. url=url+"&sid="+Math.random();
to prevent caching.
Apr 12 '07 #6
satishr23
10 New Member
yup...adding a random number to the url worked...
thanks!
Apr 13 '07 #7
acoder
16,027 Recognized Expert Moderator MVP
No problem. You're welcome.
Apr 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2542
by: Lanky | last post by:
I am using the Dynamic Ajax Content script from Dynamic Drive (http://dynamicdrive.com/dynamicindex17/ajaxcontent.htm) and trying to load the Ultimate Fade-In Slide Show also from Dynamic Drive (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm.) Both work just fine independently, but the slide show script won't work when I try to load it with the Ajax Content Script - as if they are conflicting. Any ideas?
1
1766
by: JohnnieTech | last post by:
I am using some javascript/ajax to load content into a main div. The problem I am running into is that it will work in IE but not in FF. In FF I don't get any sort of load at all. I have a 1 column 2 row setup in css. The links are in the top div and the content loads in the main div. The only problem I thought may have been causing it was that I had an ID inside of and ID. I changed my links div to a class instead of an ID and that didn't...
8
3101
by: Samik R. | last post by:
Hello, I am using the innerHTML property of a div placeholder to update the contents, and the HTML is provided from a perl script on the server side. The perl script gets called through AJAX when I press a button in the first page. The returned HTML in the div has another button, which, when pressed, should call the same perl script again. Think of the program as some sort of wizard. The problem is, this works perfectly as expected in FF...
9
2948
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the content takes a long
6
2829
by: Harshpandya | last post by:
HI all, I am working on the Ajax and PHP to make dynamic web page application I have HTML page - in which i am calling two different pages Google and NBC from Drop down menu. OUTPUT WANTED: I want the google page displayed under display message on the same page when i select google. and when i select NBC news - i want the NBC news page to be displayed under the display message on same page.
4
1566
by: Harshpandya | last post by:
HI all, I am working on the Ajax and PHP to make dynamic web page application I have HTML page - in which i am calling two different pages Google and NBC from Drop down menu. OUTPUT WANTED: I want the google page displayed under display message on the same page when i select google. and when i select NBC news - i want the NBC news page to be displayed under the display message on same page.
2
3151
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if i change something in php file using in ajax function.it not refreshed,means its shows the previous result it not get updated.i can't understand whats the prob.this is the code i m using: <? include("config.inc.php"); //error_reporting(0); ...
8
3984
by: jackrabbithanna | last post by:
I'm using a ajax script the uses a tabbed div that fetches a remote webpage to display for each tab.when clicked. the script works fine except for one thing. The content of the page i want to display is a javascript image gallery. i am trying to do multiple galleries on one page. When the page loads the default tab loads the gallery correctly. But when I click on the next tab the javascript gallery fails. The script is exactly the same...
1
3185
by: wenijah | last post by:
Hi everyone! First thank you for reading this post and yes, you probably already see that kind of topic title somewhere but the problem I've got today might be different than the 100 topics I've seen so far that did not resolve my problem... Environment and problem: I have a page A with Ajax.js and a <div id="ajx">Content</div> that changes when clicking on a link. Another page, page B, gets loaded into page A and (tries) to load a...
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.