Home > HTML, JavaScript, PHP > JavaScript – iframe inline, iframe freehand, iframe src freedom

JavaScript – iframe inline, iframe freehand, iframe src freedom

IFRAME , you want to use, and it doesnt work, using .src?  It works how you want it to work, check following.

case ‘Duplicates’:{

// [ Putting ] — Headings
$( ‘a.databaseB’ ).html( ‘(Duplicates)’ );
// [ load and progress bar show ] – xhtml/css
myAjax(‘include/add_edit_del.php?model=ajax_loginput’, ‘oper=search&about=Duplicates’);
// [ load a largest 40,000 lines of tables ] – xhtml/css and SQL database
var db = myAjaxReturn(‘include/add_edit_del.php?model=ajax_duplicates’, ‘oper=search&about=Databases’);
// [ Also i want some ajax events attached ] – pure javascript my class and libraries.
_html = ”;

/**
* The meat of IFRAME
*/
// [ { This is what you are looking for } ] — IE5 till IE8 and FF,Chrome,Opera works for me
var frame = ‘<iframe frameborder=”1″ width=”100%” height=”400px” id=”companiesframe” name=”companiesframe” src=”javascript: \’\’;” > ‘;
// [ Place where i want to put the iframe visible] — I use iframe for performance and dealing largest displays.
$(‘#database_b’).empty().append( frame) ;

// [ Now it doesnt work! ] – so i confirm the element initialized mannually
$(‘#companiesframe’).load(function(){
try {
// [ Now plain xhtml/css/js simply copy and past] — done!
$(this).contents().find(‘body’).html( db );
}catch(e){
// if anything happens. Lets rock here…
}
});
// End of the Meat.

// — Thanks
// — Shamun
// — follow me: https://shamuntoha.wordpress.com

}break;

Advertisements
Categories: HTML, JavaScript, PHP Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: