Results 1 to 2 of 2

Thread: Ajax Dynamic Load event click(function(){ value retrieval from divs

  1. #1
    Junior Member
    Join Date
    Oct 05
    Posts
    18

    Ajax Dynamic Load event click(function(){ value retrieval from divs

    Ajax Dynamic Load event click(function(){ value retrieval from divs
    Ajax dynamic website loads stuff like this, attaches links to Divs

    Code:
    <html>
    <head>
    <script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
    Wicket.Event.add(window, "load", function(event) { $("#iconContainer3").click(function(){Plimus.web.ui.openNewWindow('http://www.emagenerator.com/');});});
    /*-->]]>*/</script>
    
    <script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
    Wicket.Event.add(window, "load", function(event) { $("#iconContainer4").click(function(){Plimus.web.ui.openNewWindow('http://www.partnermark.com');});});
    /*-->]]>*/</script>
    ………..
    </head>
    <body> …….
    <div class="item-name-icon tooltip-marker " id="itemUrlIcon3a"> 
    <div id="iconContainer6" class="ui-state-default ui-corner-all ui-button-fade"><span class="ui-icon ui-icon-extlink"></span></div> </div>
    Question is how do I can get value of links 'http://www.emagenerator.com and 'http://www.partnermark.com' from divs?

  2. #2
    Hyperactive Member jasonwucinski's Avatar
    Join Date
    Mar 10
    Location
    Pittsburgh
    Posts
    443

    Re: Ajax Dynamic Load event click(function(){ value retrieval from divs

    i havent used ajax a whole lot but if the content you want is found withing a Div, you can use the innerHtml method to get it. For instance, if you had a div like this:

    HTML Code:
    1. <div id="myDiv" > Hello World</div>

    you can do this in javascript:

    javascript Code:
    1. function getIt(){
    2. var myDiv= document.getElementById("myDiv")
    3. var myText = myDiv.innerText
    4. alert(myText & 'can be found in ' & myDiv)
    5. }

    something like that should work, although i didn't test it, so check for typos
    if i was able to help, rate my post!

Posting Permissions

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