SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    title page auto refresh..?

    i have a problem about auto refresh title page in my web, not the page, but only the title page.
    can u help me guys about the script..?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,683
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by wasis View Post
    i have a problem about auto refresh title page in my web, not the page, but only the title page.
    can u help me guys about the script..?
    The title element can be edited, and will update where-ever it's used.

    Code javascript:
    var title = document.getElementById('title')[0];
    title.innerHTML = 'A new title';
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want it automatically refresh, can it do it?

  4. #4
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Could you please explain what you mean by automatically refresh as without code you have attempted to use its very difficult to offer any other solutions then what Paul has offered.

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it doesn't work..
    <script type="text/javascript">

    <!--<tpl:tmpl name="auto_ref">
    setInterval(function() {
    $.ajax({
    url: '{BASE_URL}/main.php',
    //data: {name: 'username', password: 'userpass'},
    success: function() { document.title = '$var';},
    dataType: 'text'
    });
    }, 1000);
    <!--</tpl:tmpl>
    </script>

  6. #6
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    What does $var referrer to in your code?

    Code:
    success: function() { document.title = '$var';},

  7. #7
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $var is variable that i take from database value, just assume "select * from.."..
    please help..


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
  •