Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Force Page Update?

Reply
Thread Tools

Force Page Update?

 
 
Yogi_Bear_79
Guest
Posts: n/a
 
      12-17-2005
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.


 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      12-17-2005

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.

 
Reply With Quote
 
 
 
 
Yogi_Bear_79
Guest
Posts: n/a
 
      12-17-2005

"VK" <> wrote in message
news: 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;
}


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nike air force one, air force 1, air force one low cut, air force one salewholeta@163.com Digital Photography 3 12-31-2008 04:29 PM
Nike Air Force Ones,Air Force One Air Force One-1 lky52193@gmail.com Computer Support 0 01-17-2008 04:40 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:46 PM
Nike Air Force Ones,Air Force One Air Force One-1,25th anniversary lky52112@gmail.com Digital Photography 0 01-15-2008 04:34 PM
Force databinding from an iframe page to the page that contains it? Luis Esteban Valencia ASP .Net 0 01-20-2005 04:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57