By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,666 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,666 IT Pros & Developers. It's quick & easy.

Force Page Update?

P: n/a
I have a script that parses window.location.hash to figure out which xml
file to load. The xml files populate a page on a framed site. The code works
correctly to a point.

If I have a seperate html page to support each xml it works. I would like to
eliminate the individual html pages becuase only one should be needed.

When I use one page the first link works, then the second one does nothing
(doesn't refresh the frame). If I click to a static image for the frame then
click the next xml link it works.

What can I do to force the frame to update? I am clicking on a HREF link
that should re-load the html page, but with the new xml data.
Dec 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
VK

Yogi_Bear_79 wrote:
I have a script that parses window.location.hash to figure out which xml
file to load. The xml files populate a page on a framed site. The code works
correctly to a point.

If I have a seperate html page to support each xml it works. I would like to
eliminate the individual html pages becuase only one should be needed.

When I use one page the first link works, then the second one does nothing
(doesn't refresh the frame). If I click to a static image for the frame then
click the next xml link it works.

What can I do to force the frame to update? I am clicking on a HREF link
that should re-load the html page, but with the new xml data.


Very difficult to guess w/o a code sample. Please post one or a link.

Dec 17 '05 #2

P: n/a

"VK" <sc**********@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...

Yogi_Bear_79 wrote:
I have a script that parses window.location.hash to figure out which xml
file to load. The xml files populate a page on a framed site. The code
works
correctly to a point.

If I have a seperate html page to support each xml it works. I would like
to
eliminate the individual html pages becuase only one should be needed.

When I use one page the first link works, then the second one does
nothing
(doesn't refresh the frame). If I click to a static image for the frame
then
click the next xml link it works.

What can I do to force the frame to update? I am clicking on a HREF link
that should re-load the html page, but with the new xml data.


Very difficult to guess w/o a code sample. Please post one or a link.


Thanks for the offer to help!

Here is the script: I have a three paged frame. Top is a banner, left is a
menu, right is main content, where the pictures are displayed. I know
frames are generally frowned upon. However, I haven't been able to find an
equivilent script that can display without showing a new html file for every
picture. I think this looks way better than reloading the entire page for
every pic.

var CurrentPage
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")

xmlDoc.async = false
xmlDoc.load("xml/" + location.hash.substring(1))

var x = xmlDoc.documentElement.childNodes
var iPages = x.length

function GetImage(ScrollDirection){

switch (ScrollDirection) {
case "First":
CurrentPage = 0
break
case "Next":
CurrentPage = CurrentPage + 1
break
case "Prev":
CurrentPage = CurrentPage - 1
}

if (CurrentPage > iPages-1) {
CurrentPage = 0 }
else {
if (CurrentPage < 0) {
CurrentPage = iPages-1 }
}
imgPhoto.src = x.item(CurrentPage).getAttribute("Filename")
/*
PhotoComment.innerText = x.item(CurrentPage).text
PhotoBy.innerHTML = "<IMG src='picBy.ICO' class='Icon'/> " +
x.item(CurrentPage).getAttribute("PhotoBy") + ", " +
x.item(CurrentPage).getAttribute("PhotoDate")
Loading.innerHTML = "Downloading high res image.<BR/><BR/><IMG
src='Loading.gif' class='Loading'/><BR/><BR/>Please wait..."
*/
}

function imageLoad()
{
/* Loading.innerHTML = "" */
}
function SetScreenMode(NewMode)
{
switch (NewMode) {
case "full":
window.open(getURL(), 'fullscreen', 'fullscreen=yes, scrollbars=auto')
break
case "close":
close()
}
}

function getURL()
{
return document.URL;
}
Dec 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.