PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 15, 2022

[FIXED] How do you access the top level of the DOM from jQuery?

 April 15, 2022     dom, iframe, javascript, jquery     No comments   

Issue

Trying to figure this out... I'm trying to accessthe top level of the dom from inside an iframe. How possible is this?


Solution

From inside of a frame you can always get to the top level using window.top. You can check to see if you are in a frame using:

var iAmInAFrame = (window.top == window.self);

You should be able to use window.top.document.whatever (e.g. body, getElementById(), etc.) to manipulate the top level document provided that you share a domain.



Answered By - Prestaul
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing