javascript - Applying a title tag to a frame within an iFrame -



javascript - Applying a title tag to a frame within an iFrame -

i trying add together title tags frames within iframe. files reside on same domain.

the total selector html page loading within iframe "html > frameset:nth-child(2) > frame:nth-child(1)"

however using next code not update attribute frames within iframe.

$('#project_frame').contents().find('frame').attr('title','table of contents'); <iframe id="project_frame" name="project_frame" src="<?= $uri ?>" frameborder="0" title="project_frame"></iframe>

the iframe loading source asynchronous main execution, here's nice trick create desired code wait 'til it's loaded:

<iframe id="project_frame" name="project_frame" src="<?= $uri ?>" frameborder="0" title="project_frame"></iframe> $("#project_frame").load(function () { $("#project_frame").contents().find('frame:first').attr('title', 'table of contents'); });

found here: javascript callback when iframe finished loading?

javascript jquery html iframe

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -