User Profile

Collapse

Profile Sidebar

Collapse
renphi
renphi
Last Activity: Aug 11 '08, 06:14 AM
Joined: Jul 31 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • renphi
    replied to Pass ID to function?
    Varies, but in this case ~15,000....
    See more | Go to post

    Leave a comment:


  • renphi
    replied to Pass ID to function?
    Upon further inspection the following function is causing Internet Explorer to hang.

    Code:
    window.onload = function () 
    {
        var arr = document.getElementsByTagName("li");
        for(var i = 0; i < arr.length; i++)
        {
            document.getElementsByTagName("li")[i].onclick = sendRequest;       
        }
    }
    This is getting seriously frustrating....
    See more | Go to post

    Leave a comment:


  • renphi
    replied to Pass ID to function?
    I may have spoken too soon. While the following code works well in Firefox, it fails with large sets of data in Internet Explorer 6 & 7 pinning the CPU at 100%. Is there something in there causing this issue?

    Code:
    // Create XmlHttp object.
    function createXHR()
    {
        try { return new XMLHttpRequest(); } catch(e) {}
        try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e) {}
    ...
    See more | Go to post

    Leave a comment:


  • renphi
    replied to Pass ID to function?
    It now works after changing the following:
    Code:
    window.onload = function () 
    {
        var arr = document.getElementsByTagName("li");
        for(var i = 0; i < arr.length; i++)
        {
            document.getElementsByTagName("li")[i].onclick = sendRequest;       
        }
    }
    And added:
    Code:
    var theId
    function getId(e)
    {
        var
    ...
    See more | Go to post

    Leave a comment:


  • renphi
    started a topic Pass ID to function?

    Pass ID to function?

    I'm attempting display a DIV when clicking on a list item. This works, but only for the first list item. I realized that this was due to the ID not being unique so I made the IDs unique. My question is how do I pass this unique ID from each list item to the relevant javascript function so that it displays the DIV when clicked?

    Here's the javascript:
    Code:
    // Create XmlHttp object.
    function createXHR()
    {
    ...
    See more | Go to post
No activity results to display
Show More
Working...