webmasters
webmasters

Reputation: 5831

Html include inside Jquery

Can i place html include inside Jquery?

Here is the code:

    $(document).ready(function(){

$(".photo").hoverIntent(function() {
    $(this).html('CAN I PLACE HERE A HTML INCLUDE?');
}, function() {
    $(this).html('<img src="' + $(this).attr("title") + '" width="248" height="186" style="border-bottom: 1px solid #2B2B2B;"/>');
});

});

Upvotes: 1

Views: 1828

Answers (2)

webmasters
webmasters

Reputation: 5831

Not good, when i use load(file.html); it reddirects my site to that file only.

I just want to replace certain html on my page with jquery

Upvotes: 0

Sarfraz
Sarfraz

Reputation: 382686

Use the load function:

$(this).load('file.html');

Upvotes: 3

Related Questions