Results 1 to 5 of 5

Thread: Page refresh automatically after page loaded?

  1. #1
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Page refresh automatically after page loaded?

    Hi,
    I have a tooltip that is javascript but works for the first page but on next page
    one has to (F5) refresh for it to work.

    I thought of refreshing it automatically just one after load.

    I added the following code to the body onload but the page then refreshed all the time!
    [code]
    "JavaScript:location.reload(true);"

    where would i put this or call it automatically

    Please help!

    Regards

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,374
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    This really means that you have some other problem, most likely one that can be resolved without a refresh, and one, that if it can be solved some other way, should.

    However, you can do:

    HTML Code:
    <body onload="if(!/reloaded/.test(window.location.serach)){window.location.replace(window.location.href+'?reloaded=1');}">
    This will do a one time refresh. But not if the page is later navigated to using the back button.

    Further, a javascript refresh often doesn't work like a human initiated refresh, as far as the characteristics of the page go, though sometimes it does. This is the main reason why it is best to find and correct the cause of the problem, rather than try to kludge through it with a resource wasting refresh.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Thanks for the help - but i'm kind of in a big mess

    Hi, i had a javascript tooltip which was in an xskt file that loaded a aspx page.
    so it works the first time, but when i user selects autopost which is a script in the aspx file the tooltip is lost.

    I was thinking of adding it to the aspx file - which i was just informed if i change the file (all other processes are using it) other will be affected

    The tooltip is javascript which is client side & aspx file the reloads scripts is server side.

    So i don't really know what to do!

    Maybe a javascript that executes in a vbscript to realod current page only once automatically!

    Regards

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,374
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    Sounds like you are a bit confused. If I had a link to the page I might be able to figure it out. The mixture of server side and other code will make hard for me to see all of the processes involved, but I would try.

    Refreshing should be avoided if at all possible.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2007
    Posts
    88
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile Thank You - I found a complete CSS tooltip,

    Thank You, Thank You very, very much - i was so lost.

    I found a complete CSS tooltip, so i do not need to just refresh the page first when user enter & my clientside tooltip would not work once user autopsost - so i was trying to just make it work the first time.


    Lucky, Lucky Me - I found A Complete CSS Tooltip that i used in my xslt file


    Thank you for your help & kindness, I'm gratefull and really appreciate it.

    Thank You!!!


    [CODE]

    <div id="hoverText" class="main" style="background: url(../../images/template/glass/c.png); padding: 5px; position: absolute; display: none"></div>

    <script type="text/javascript">
    var hoverText = document.getElementById('hoverText');
    function showHover(txt, e){
    if(document.all){
    xpos = event.clientX + document.body.scrollLeft;
    ypos = event.clientY + document.body.scrollTop;
    }
    else{
    xpos = e.pageX;
    ypos = e.pageY;
    }

    hoverText.innerHTML = txt;
    hoverText.style.left = xpos + 'px';
    hoverText.style.top = ypos + 14 + 'px';
    hoverText.style.display = "block";
    }
    function hideHover(){
    hoverText.innerHTML = "";
    hoverText.style.display = "none";
    }
    </script>

    <xsl:element name="asp:image">
    <xsl:attribute name='id'>ttip_<xsl:value-of select='@name' /></xsl:attribute>
    <xsl:attribute name='runat'>server</xsl:attribute>
    <xsl:attribute name='imageurl'>images/help.jpg</xsl:attribute>
    <xsl:attribute name='onmousemove'>showHover('<xsl:value-of select="Tooltip" />', event)</xsl:attribute>
    <xsl:attribute name='onmouseout'>hideHover()</xsl:attribute>
    <xsl:attribute name='class'>main</xsl:attribute>
    </xsl:element>


    Thank You Very Much for your time & kindness!!!

    Regards

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •