473,466 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Refresh an iFrame and not my whole website.

Hello, my name is Martin and I am the owner of www.tot1clan.com
as you can see, to the very right on my website is a server status box for my BFBC2 server. I have tried to make only the server status box refresh, but the whole page refreshes for me :/
So can any of you pro people please edit and post back the correct code for my server status box so that only the box refreshes and not the whole site?

Thank you :D

Expand|Select|Wrap|Line Numbers
  1. <center>
  2. </style>
  3. <script LANGUAGE="JScript" >
  4. window.setInterval(refreshGadget, 50000);
  5. function refreshGadget() 
  6. {location.href = location.href;}
  7. </script>
  8. </head>
  9. <p style="text- align: right;">
  10. <body bgcolor="#000000">
  11. <iframe src="http://cache.www.gametracker.com/components/html0/?host=85.236.109.61:19667&bgColor=222222&titleBgColor=11111D&borderColor=333333&fontColor=8790AE&titleColor=FFFFFF&linkColor=FF9900&borderLinkColor=999999&showMap=1&showCurrPlayers=0&showTopPlayers=0&showBlogs=0&width=200" frameborder="0" scrolling="no" width="200" height="267"></iframe></body>
  12. </html>
  13. </center>
  14.  
Sep 30 '10 #1
3 3909
acoder
16,027 Recognized Expert Moderator MVP
Give the iframe an ID <iframe id="iFrame" and then access the iframe with document.getElementById("iFrame"), then reload the iframe by setting its src to itself. There's another option too, but try this one first.
Oct 1 '10 #2
Hi, I'm very sorry, but I didn't understand much of what you just said :P All i have done was to turn a windows 7 gadget into this by removing the top lines. I am very noobish at these stuff, so can you post the finished code or something? That would be VERY handy :D /cheers
Oct 1 '10 #3
acoder
16,027 Recognized Expert Moderator MVP
You'd add the code within the refreshGadget() function (line 6 replacing the existing code), e.g. something like:
Expand|Select|Wrap|Line Numbers
  1. var iframe = document.getElementById("iFrame");
  2. iframe.src = iframe.src;
Note that this may not work depending on your settings, but there's ways round that.
Oct 2 '10 #4

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

Similar topics

10
by: Conax | last post by:
Hi there, My boss is hoping that I can come up with a page that displays some information. The information will always be displayed on specific part of the page, with auto refresh. But he...
3
by: Sascha Möllering | last post by:
Hi, I have a website displayed in an iframe with anchors (it`s a navigation tree) an every time I click on an object in my navigation tree, the whole website moves. Is it possible to move the...
1
by: Lubo¹ ©lapák | last post by:
Hi, Can I, after click on button, from Iframe in aspx page refresh this whole aspx page? Thanks Lubos.
1
by: Helixpoint | last post by:
I have a frameset. left and main. Inside the main frame I have a IFRAME. I need to refresh the main frame when I post a form inside the IFRAME. I am trying the code below with no luck?? ...
5
by: Jacob | last post by:
How do I refresh an iframe via JavaScript from the parent page? /Jacob
1
by: spolsky | last post by:
hi, i have the following pages. when form submitted with the field1 value is "ok" then the iframe must be loaded with the text "Page loaded...". This works fine with IE 6 and FireFox(1.5) but...
2
by: mahesr | last post by:
Frds, how to crawl a specific word in whole website using php.need which page it has Example: want to crawl a 144 items found,on somepage.html. Pls if u have code pls mail email address...
5
by: Kaante | last post by:
Hi, I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website. I want to have a message icon on the top frame which would flash once the...
2
by: teressa | last post by:
Hi Everyone, I was given a task to fix our printer friendly pages: Best practice recommendation was to dynamically load a JavaScript page. I have an asp page which is a printer-friendly page...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.