I'm trying to code a JQuery function, which views the content
of a second html-page in the #content-div of my main html-page, when I
MouseOver the link. When I MouseOut the link the #content-div of my
main html should be viewed again.
This is the code of my link in the HTML-File:
<a href=""
id="infojq">InfoJQUERY</a>
Code in
my javascript file:
$(document).ready(function()
{
$('#infojq').mouseover(function()
{
//var x = '#content'; idea here was to save
div-content in x..
//$('#content').load('magicpage.html');
$('#content').html('magicpage.html');
}
);
$('#infojq').mouseout(function()
{
//$('#content') = x; >> insert x into div..
//$('#content').load('index.html'); >>
worked good but i only need the
//
content from the
#content-div and not the whole html-file
$('#content').html('index.html');
}
);
}
);
The result now is that the div-content is replaced
with the String "magicpage.html" and when I MouseOut it
views the String "index.html".
My problem is that I don't know how to only read/view the content of one specific
div-box in an html-file , save it somewhere if necessary and the use
it again to write into a div-box.