SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Jul 2003
    Location
    Toronto, Ontario
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Script is Invisible on IE?

    Hey guys,

    I recently purchased a script and being the avid Firefox user I didn't even think to check to see if it worked fine in IE.

    The script works fine in Firefox, however in IE it's invisible. You can view the example here...

    http://www.resourcebubble.com/test/sample-usage.php

    Is there a certain reason why it doesn't work in ie? Is there anything I could do?

    I will post code if required.

    So anybody have any idea why it might not be showing up?

    Thanks,
    Mario

    Edit - I juat had a friend test it and he said he got an error that said...

    "object doesn't support this property or method on line 55"
    $ Available For Hire
    Need a website designed or coded? Then feel free to contact me!

    PSP Backgrounds - PSPBG.net || Photoshop Brushes - PSBrushes.net

  2. #2
    $books++ == true matsko's Avatar
    Join Date
    Sep 2004
    Location
    Toronto
    Posts
    795
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes the IE browsers fail or act really weird when they come across a variable assignment without a var prefix (unless the variable has already been assigned prior with a var prefix).

    In this case wq_ticker_temp has not been assigned anywhere with a var prefix and that causes an error on line 55.

    Fixing this should make everything work, but you should also put proper markup around all the <script> tags.
    I can't believe I ate the whole thing

  3. #3
    SitePoint Addict
    Join Date
    Jul 2003
    Location
    Toronto, Ontario
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    Thank you so much for the reply.

    Unfortunately I've never coded a line fo Javascript in my life, so if there is anybody out there hat would be willing to help me out with this solution maybe we can work something out.

    I've attached the files, if anybody wants to take a look and help with the problem.

    Thanks again,
    Mario
    Attached Files Attached Files
    $ Available For Hire
    Need a website designed or coded? Then feel free to contact me!

    PSP Backgrounds - PSPBG.net || Photoshop Brushes - PSBrushes.net

  4. #4
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ethics View Post
    Unfortunately I've never coded a line fo Javascript in my life, so if there is anybody out there hat would be willing to help me out with this solution maybe we can work something out.
    The problem is that it's creating global variables and IDs with the same name, which I.E. wont allow, and it's incredible that anyone charging for a script would miss that.
    This version renames the IDs so that there's no clash. It's still an abortion though
    Code:
    <script type="text/javascript">
    
    var wq_ticker_speed = 2;
    
    //END TICKER CONFIG
    
    var wq_ticker_content='<nobr> <span class=ticker_text_start>Stock Quotes:</span>  <span class=ticker_symbol>MSFT</span>  <span class=ticker_quote_last>25.57</span> <span class=ticker_change_minus>-0.28</span> <span class=ticker_changep_minus>-1.08%</span> <span class=ticker_symbol>GOOG</span>  <span class=ticker_quote_last>548.88</span> <span class=ticker_change_minus>-5.65</span> <span class=ticker_changep_minus>-1.02%</span> <span class=ticker_symbol>YHOO</span>  <span class=ticker_quote_last>24.28</span> <span class=ticker_change_minus>-0.36</span> <span class=ticker_changep_minus>-1.46%</span> <span class=ticker_text_end> Updated at: 10:09 ET - U.S.</span></nobr>';
    
    var divonclick = 0;
    if(document.all) {
      wq_ticker_speed = wq_ticker_speed;
    } else {
      wq_ticker_speed = Math.max(1, wq_ticker_speed-1);
    }
    var wq_ticker_copy_speed = wq_ticker_speed;
    var wq_ticker_pause_speed = (1==0) ? 
      wq_ticker_copy_speed : 0
    var are_we_on_a_nice_browser = document.all || document.getElementById;
    if (are_we_on_a_nice_browser) {
      document.write('<span id="wq_ticker_tempSpan" style="visibility:hidden;position:absolute;top:-100px;left:0px">'+wq_ticker_content+'</span>');
    } else {
      document.write("This browser is not supported by ticker!");
    }
    
    if (are_we_on_a_nice_browser){
      with (document) {
        document.write('<table border="0" cellspacing="0" cellpadding="0" class="ticker_container"><td>')
        write('<div id="tickerDiv" onMouseover="wq_ticker_copy_speed=wq_ticker_pause_speed" onMouseout="wq_ticker_copy_speed=wq_ticker_speed">')
        write('<div id="wq_tickerDiv" style="overflow:hidden;position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
        write('</div>')
        document.write('</td></table>')
      }
    }
    
    function wq_ticker_scroll()
    {
      if (parseInt(wq_ticker.style.left)>(wq_ticker_actual_width*(-1)))
      {
        wq_ticker.style.left=parseInt(wq_ticker.style.left)-wq_ticker_copy_speed+"px"
      } 
      else 
      {
        wq_ticker.style.left = ticker.offsetWidth + "px";
      }
    }
    
    var wq_ticker_actual_width = '';
    var wq_ticker, ticker;
    
    if (window.addEventListener) {
      window.addEventListener("load", wq_ticker_populate, false);
    } else if (window.attachEvent) {
      window.attachEvent("onload", wq_ticker_populate);
    } else if (document.all || document.getElementById) {
      window.onload = wq_ticker_populate;
    }
    
    function wq_ticker_populate(){
      if(document.getElementById) {
        wq_ticker = document.getElementById("wq_tickerDiv");
        wq_ticker_temp = document.getElementById("wq_ticker_tempSpan");
        ticker = document.getElementById("tickerDiv");
      } else {
        wq_ticker = document.all.wq_tickerDiv;
        wq_ticker_temp = document.all.wq_ticker_tempSpan;
        ticker = document.all.tickerDiv;
      }
    
    
      if (0 && get_cookie("wq_ticker_last_pos") != "") {
        wq_ticker_get_last_pos();
      }
      wq_ticker.innerHTML = wq_ticker_content;
      wq_ticker.style.left= ticker.offsetWidth + "px";
      wq_ticker_actual_width =  wq_ticker_temp.offsetWidth;
      wq_ticker_time = setInterval("wq_ticker_scroll()", 20);
    }
    
    function get_cookie(Name) {
      var search = Name + "=";
      var ret = "";
      if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
          offset += search.length;
          end = document.cookie.indexOf(";", offset);
          if (end == -1) {
            end = document.cookie.length;
          }
          ret = unescape(document.cookie.substring(offset, end));
        }
      }
      return ret;
    }
    
    function wq_ticker_save(){
      document.cookie = "wq_ticker_last_pos="+wq_ticker.style.left
    }
    
    function wq_ticker_get_last_pos(){
      wq_ticker_last_pos = parseInt(get_cookie("wq_ticker_last_pos"));
      wq_ticker.style.left = parseInt(wq_ticker_last_pos)+"px";
    }
    
    </script>
    Tab-indentation is a crime against humanity.

  5. #5
    SitePoint Addict
    Join Date
    Jul 2003
    Location
    Toronto, Ontario
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Logic Ali,

    Thank you so much for taking the time to look through the files. It seems to be working now thanks to your changes.

    It's bad enough they charge, their contact pages don't work making support through them impossible.

    Thanks thought, it's greatly appreciated.
    Mario
    $ Available For Hire
    Need a website designed or coded? Then feel free to contact me!

    PSP Backgrounds - PSPBG.net || Photoshop Brushes - PSBrushes.net


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
  •