473,698 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax page not getting refreshed in IE

134 New Member
hi

i have a php page in which i have included few tabs links like

games, news,entertainm ent etc.,

when i click the tablink an ajax page is loaded below.
In that ajax page several pages(iframes) are loaded inside the tables, such that it contains three tables in a row.
each table contains different pages loaded through iframes,
and an close button is available so that we can close the unwanted tables(containi ng frames).

"i hav done similar to igoogle drag and drop portion without drag option"

so if we close an table the page name is stored in the database and it is not diaplayed.,

The problem is when i close the tables(page containing iframes) its getting closed and the values are stored correctly in the database., but after that if i click the same tablink the ajaxpage gets loaded along with the closed tables(which i have closed).
i,e the page gets loaded with the old datas without getting the refreshed values from the database.,

it works well in firefox.,

Can anyone help me.,

regards
vijay
May 16 '08
18 2713
hsriat
1,654 Recognized Expert Top Contributor
if i click on another tab(example:new s) before the tab(containing games) gets loaded-> mismatch occurs.,
the titles of the tables gets changed but the contents(frames ) didnt get changed.
Apparently, you are changing the name of the tab and then sending the Ajax request. Instead, you need to run the change-name part of code in the onreadystatecha nge function, after you receive the xmlHttp response.
Jun 5 '08 #11
vjayis
134 New Member
sorry to say this.,

i am unable to implement the ideas given by you.,

so could you explain me briefly with some coding.,

here is my full script used to load the another page while selecting another tab.,

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. function tabs123(tab,type,data3,data4)
  4. {
  5. try
  6.   {
  7.   tabs=new XMLHttpRequest();
  8.   }
  9. catch (e)
  10.   {
  11.   try
  12.     {
  13.     tabs=new ActiveXObject("Msxml2.XMLHTTP");
  14.     }
  15.   catch (e)
  16.     {
  17.     try
  18.       {
  19.       tabs=new ActiveXObject("Microsoft.XMLHTTP");
  20.       }
  21.     catch (e)
  22.       {
  23.       alert("Your browser does not support AJAX!");
  24.       return false;
  25.       }
  26.     }
  27.   }
  28. def5=document.getElementById("defaulthid").value;
  29. tabs.onreadystatechange=function()
  30.  if(tabs.readyState==1)
  31.  {
  32.      document.getElementById("tabimage").style.display="block";
  33.  }
  34. if(tabs.readyState==4)
  35.  { 
  36.     document.getElementById("tabimage").style.display="none";
  37.     document.getElementById("tabs").innerHTML=tabs.responseText;
  38.  }
  39. }
  40. var dd=(new Date()).getTime();
  41. tabs.open("GET","tabselection.php?tabname="+tab+"&type="+type+"&data3="+data3+"&data4="+data4+"&cache="+dd,true);
  42. tabs.send(null);
  43.  
  44. }
  45. </script>
  46.  
  47. <a style="cursor:pointer" onClick="tabs123('games','<? echo $tablename;?>','<? echo $data3;?>','<? echo $data4;?>')" >Games</a>
  48.             <a  style="cursor:pointer" onClick="tabs123('news','<? echo $tablename;?>','<? echo $data3;?>','<? echo $data4;?>')" >news</a>
  49.  
  50. <div id="tabs"></div>
  51.  
Jun 5 '08 #12
acoder
16,027 Recognized Expert Moderator MVP
There are two ways to solve this. One way is to check if the ajax object's readyState is 0 (uninitialized) . If it's not, abort the request.

The second way is to just swap the open() and onreadystatecha nge lines, i.e. place the open() call before the onreadystatecha nge event handler.
Jun 5 '08 #13
vjayis
134 New Member
There are two ways to solve this. One way is to check if the ajax object's readyState is 0 (uninitialized) . If it's not, abort the request.

The second way is to just swap the open() and onreadystatecha nge lines, i.e. place the open() call before the onreadystatecha nge event handler.



i tried out the second way as u suggested.,

but i also like to know how to implement through first method u r saying.,
i am stuck., how to implement it.,
here i check whether the object's readystate is 0.,
Expand|Select|Wrap|Line Numbers
  1. if(xmlHttp.readyState==0)
  2. {
  3. }
  4.  
i dont know what to do within this., to abort the request.,

and if the request is aborted what will happen., the present operation will gets aborted or already running(previou s) operation will get aborted??

regards
vijay
Jun 19 '08 #14
acoder
16,027 Recognized Expert Moderator MVP
i tried out the second way as u suggested.,
I assume that worked then?

but i also like to know how to implement through first method u r saying.,
i am stuck., how to implement it.,
Something like this:
Expand|Select|Wrap|Line Numbers
  1. if(xmlHttp.readyState!=0)
  2. {
  3.     xmlHttp.abort();
  4. }
  5.  
and if the request is aborted what will happen., the present operation will gets aborted or already running(previou s) operation will get aborted??
There's only one Ajax object, so the previous one will get aborted to allow you to use it for the current request.
Jun 19 '08 #15
vjayis
134 New Member
thanks for your guidelines given.,

and i have a another error.,

As i had told already i m having many tabs in the page which contains frames having unique datas.,

and different frames are loaded in that section by selecting the tab.,

it gets loaded.,and after selecting some tab(say second tab) and i m going to another page using a link.,

Note: this link doesnt comes inside the ajax section., it is displayed above that section.,

when i m going to next page using a link,and coming back to this previous page(i,e page containing ajax) using the back button provided by the browser., the frames are not located in to the their own sections., it gets swaped.,

so i want the user to come back to this page by using a link.,

how can i load the page without mismatch.,

do i need the disable the back button functionality of the browser or is there a way to load the datas correctly when returning back.,

regards
vijay
Jun 25 '08 #16
acoder
16,027 Recognized Expert Moderator MVP
No, don't attempt to disable the back button. You can't reliably anyway.

You can either build in history using the location hash property (there are some history frameworks out there), or use cookies. When an Ajax request is made, set a cookie. When you come back to the page, if the cookie is set, make those requests again.
Jun 25 '08 #17
vjayis
134 New Member
No, don't attempt to disable the back button. You can't reliably anyway.

You can either build in history using the location hash property (there are some history frameworks out there), or use cookies. When an Ajax request is made, set a cookie. When you come back to the page, if the cookie is set, make those requests again.


Can u explain me briefly with some examples.,

coz i have not implemented nay of the way u have mentioned.,
thanks
Jun 26 '08 #18
acoder
16,027 Recognized Expert Moderator MVP
Search for ajax back button and you should find some useful links.
Jun 26 '08 #19

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

Similar topics

0
1828
by: arunprabu | last post by:
Hi, I have a problecm with the AJAX request in my webpage. I have some filters on top of the page. I have a submit button and an empty div below the filters. Some of the filters have ajax requests to update the content within the filters. For example, I have 2 drop downs, one for state and another for country. When I select a country in the country drop down, an ajax request is sent to fetch appropriate list of states and updates the
9
1868
by: =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post by:
Hi all, I followed first walk through sample from http://ajax.asp.net/docs/tutorials/IntroductionUpdatePanel.aspx to create my first testing page, The problem is after I clicked that botton, it still trigged a postback. Do I miss something? Following is my code: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
3
2338
by: msinghal | last post by:
hi, I am facing one problem which is related to AJAX. I have a html page which has some links. When the page is refreshed using AJAX then if some new new link is added to the page on this refresh, then the onClick function of this particular link is not working. Plz help
8
1702
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm about to finally make the jump and start a new site using AJAX. THe question i have for all of you AJAX developers out there is which one? 1. The Standard AJAX frame work 2. The Tool kit. 3. Or are there others out there. 4. Should i not do AJAX at all because it still posts back the entire page even though only the section is refreshed. (someone tell me i'm wrong here and why please!)
2
8830
by: kpg | last post by:
I have an AJAX enabled web service consumed by an AJAX enabled web app, given a zip code it returns the city and state. Tested the web service, it works fine. I created a services collection in the script manager and pointed to my web service. I call the web service from an html input button click,
2
1718
by: JimL | last post by:
Hi, I've been given the job of "Ajaxifying" an existing application. If I create a new test page in the application, Ajax works fine. However when I add a scriptmanager and updatepanel to an existing page, it doesn't work - the page just gets completely refreshed. In each case, the Ajaxy parts of the .aspx file look identical, but when I look at the HTML in the browser page, I find that in the failing example, there is script at all...
10
2133
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the Master pages as their master...) the entire page is refreshed - also the menu which belongs to the master, how can I fix it - so only the inside content will be refreshed ?
1
3397
by: =?Utf-8?B?TW9oc2luIEtoYW4=?= | last post by:
Hi, I am working on a website where i am creating Horizontal Menus Dynamically from database as per rights available to the user. I have several UserControls. And the Menu control also brings UserControl's URL stored in Database while Page load. There is a TabContainer control below the Menu Control. Now i want to add corresponding UserControl dynamically when user clicks on
8
2509
by: knkk | last post by:
Instead of an id getting its innerHTML changed, the entire page is getting refreshed with this function of mine (you may want to look just at the end of the function where there's an alert): function morerating(ratingform, checkflag, loc) { var f = document.forms; var rating_done_flag = 0; var params = ""; if (checkflag == true) check = checkrating(ratingform); else
0
8674
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
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
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...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
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...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
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...
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.