Jump to content

JQuery load external divs


jamesxg1

Recommended Posts

Hiya peeps,

 

I have a JQuery script that loads a external page and displays it I was wondering how I would use the divs and classes in the external content

 

EG.

 

Index

Load external

 

External

<div id="BLAH"></div>

 

use #BLAH in Index

 

Many thanks

 

James.

Link to comment
Share on other sites

I know I thought the same. But it appears not here's what I have done and the snippets.

 

In 'index' I have a div that loads all the thread contents from 'responder.php' using a switch function then I have made it so that each thread is a link, I need the link to load another switch function upon onclick. Also I was wondering how I would fetch the specific content eg how do I make it so that I can also send the the a hrefs class value as a param to the load function.

 

Index

		
$('a#viewthread').click(function() {

	$('div#post_new').slideUp('slow').empty().hide();
	$('div#threads').slideUp('slow').empty().hide();
	$('div#start').slideUp('slow').empty().hide();
	$('div#question').load('responder.php?mode=readquestion').show().fadeIn('slow');

	});

 

This is what the treads snippet is to make them a link but the link isnt working.

echo '<a href="#" title="View this question" accesskey="V" id="viewthread"><table class="tablebg" width="100%" cellspacing="1">'; 
echo '<tr>'; 
echo '<th>' . $this->unsolved['title'] . '</th>'; 
echo '</tr>';
echo '<tr>'; 
echo '<td class="row1" align="center"><br /><p class="gen">' . $this->unsolved['body'] . '</p><br /></td>';
echo '</tr>'; 
echo '</table></a>';

 

Sorry about it having all them echo's lol.

 

Many thanks

 

James.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.