#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    659
    Rep Power
    38

    Using jQuery to update 2 div's with deeplinking


    OK, I have working sample here

    The issue is that I need to be able to insert 2 different files into 2 different div's. I've worked on this a bit before, but no luck.

    Here is my code:
    Code:
    <script type="text/javascript">
    	/*<![CDATA[*/
    	$("document").ready(function(){
    
    	    function loadURL(url) {
    	    	console.log("loadURL: " + url);
    	    	$("#area").load(url);
    	    }
    	    
    	    
    	    // Event handlers
    	    $.address.init(function(event) {
    	        console.log("init: " + $('[rel=address:' + event.value + ']').attr('href'));
    	    }).change(function(event) {
    	    	$("#area").load($('[rel=address:' + event.value + ']').attr('href'));
    // sean's code
    	    	$(document).attr("title", 'SMS ' + ($(this).attr('href')));
    //end sean's code
    
    	    	console.log("change");
    	    })
    	    
    	    $('a').click(function(){
    	    	loadURL($(this).attr('href'));
    //sean's code
    		$(document).attr("title", 'SMS ' + ($(this).attr('href')));
    //end sean's code
    	    });
    	    
    	    });
    	    
    	/*]]>*/
    	</script>
    </head>
    <body>
    
    	
    	<a href="test1.html" rel="address:/test1">Test 1</a> <br />
    	<a href="test2.html" rel="address:/test2">Test 2</a> <br /> <br /> <br />
    	
    	Load Area: <br />
    	<div id="area"></div>
    can anyone tell me how to manipulate this code, so that I can insert information into another div, when a link is clicked?

    Both div's should update when a link is clicked, and this new page will be bookmarkable.

    Sorry for posting so much code

    thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    101
    Rep Power
    27
    Can you try to explain better exactly what it is you want to accomplish?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2008
    Posts
    659
    Rep Power
    38

    hey mod_speling


    OK, I'm going to load all the content in one div instead of two different contants in two different div's on the page.

    I am using jQuery's AJAX feature to accomplish this.
    So since I found a work around. I no longer need assistance.

    thanks for the reply anyway

IMN logo majestic logo threadwatch logo seochat tools logo