November 2011
Intermediate to advanced
320 pages
10h 18m
English
Scripting-related pseudo-URLs, such as javscript:, are a very curious mechanism. Using them to load some types of subresources will lead to code execution in the context of the document that attempts to load such an operation (subject to some inconsistent restrictions, as discussed in Chapter 4). An example of this may be
<iframe src="javascript:alert('Hi mom!')"></iframe>More interestingly (and far less obviously) than the creation of new subresources, navigating existing windows or frames to javascript: URLs will cause the inlined JavaScript code to execute in the context of the navigated page (and not the navigating document!)—even if the URL is entered manually or loaded from a bookmark.
Given this ...
Read now
Unlock full access