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
https://forums.phpfreaks.com/topic/189105-jquery-load-external-divs/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.