Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get frame source with jQuery (after the source has changed)

Tags:

jquery

frames

This jQuery will return the source URL of a frame:

$('#frame-name').attr('src')

But if a link inside the frame is clicked, the original source is still returned.

Is it possible to detect the new source URL? Or get the source of the new document loaded in the frame? If either of those is a yes, are there security constraints if the source frame contains an URL from a different domain?

like image 875
ryonlife Avatar asked Feb 14 '09 20:02

ryonlife


1 Answers

parent.frames[1].location.href;

Not jQuery, but what I was looking for. However, kicks a security error if the source is on a different domain.

like image 58
ryonlife Avatar answered Oct 22 '22 23:10

ryonlife