Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    [URG] Accessing some attributes | Need some ideas

    Hi guys...
    I've this products list.
    When u click on any of them, its href (link) is opened in CENTDOW frame...

    Code:
    <span class="green">
    <a href="http://www.myweb.com/fichas/barebone/app2408.htm" 
    target="centdow"><strong>BAREBONE AMD/266/DDR</strong></a><br />
    <a href="http://www.myweb.com/fichas/barebone/app2409.htm" 
    target="centdow"><strong>BAREBONE AMD/333/DDR</strong></a><br />
    <a href="http://www.myweb.com/fichas/barebone/app2521.htm" 
    target="centdow"><strong>BOLSA BAREBONE</strong></a><br /></span>
    This product list is loaded @ start, and i'd like to call a JS function when this list has been loaded.

    a) <body onload="JavaScriptpeniteminframe(firstitemurl);">
    AM I WRONG WITH THIS ?

    b) This function (openiteminframe) should load automatically the 1º of the items in the CENTDOW frame.

    So, when products list finished loading, the 1º item is shown in CENTDOW frame.

    I can only modify product list, nothing else...

    ------------------------------------------

    Does some1 have an idea about how to access 1ºitem's href property and pass that string to this function ?

    Code:
    function openiteminframe(url) {
      window.top.frames.centdow.location = url;
    }
    I call to above function in a) ... ...

    -------------------------------------------

    I thought of making an <span id=xx> for the first item, but i don't know how could i access to that span from openiteminframe function or anywhere

    Sorry 4 making this so long.
    Hope you have understood my idea...

    Hope your help, coz tomorrow i gotta show this to my boss.

    THANKS !!
    Henry Becerra
    Mambo & Joomla templates | www.beza.com.ar
    MSN: qbecerra @ hotmail.com
    San Juan - Argentina

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    	<head>
    		<title>50250</title>
    	</head>
    	<body>
    		<ul id="items">
    			<li><a href="/item/1/">Item 1</a></li>
    			<li><a href="/item/2/">Item 2</a></li>
    		</ul>
    
    		<script type="text/javascript">
    			var links = document.getElementById("items").getElementsByTagName("a");
    
    			window.onload = function(){window.location = links[0].getAttribute("href")};
    		</script>
    	</body>
    </html>

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    omg
    hemebond, this is what i call a "QUICK & HELPFUL ANSWER"
    Thanks a lot dude...
    Henry Becerra
    Mambo & Joomla templates | www.beza.com.ar
    MSN: qbecerra @ hotmail.com
    San Juan - Argentina


  •  

    Posting Permissions

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