Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using javascript to open a new window and display parent's source 1

Status
Not open for further replies.

Zilflic

Programmer
Feb 23, 2005
17
US
Is there a command or way to open a popup window and display the parent's source code in IE?

I'm in an IE only environment where all the menus, tool bars, address bar, and right-clicking is disabled, but am expected to debug js.

Any help would be appreciated!
 
Create a new bookmark in IE and set this as the URL for the bookmark:
Code:
javascript:void(window.open("javascript:document.open(\"text/plain\");document.write(opener.document.body.parentNode.outerHTML)"))

I pulled that code directly from adam0101's faq on bookmarklets.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Cory, adam's bookmarklet is pretty nice for debugging programs that use javascript to change the innerHTML of elements, or other DOM manipulation commands that don't show up on a view-source.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
cLFlaVA,

thanks for the code.

Unfortunatley we have a java wrapper for IE and are expected to debug the js. We don't even get to see all the layers for createing the GUI. I'm not sure if all the bars are disabled through js or our wrapper. We have no way to create a bookmark by useing IE. Right clicking does nothing and the only thing we see is exit or minimize other than the main window, hence my question.
 
Zilflic, you can also copy/paste the code I posted above straight into the address bar and it should do the same thing for you. Kind of a pain in the @$$ to have to copy/paste it every time, but it should work.

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Ha! No address bar either. This is not a typical web app. would it work as a link?
 
Zilflic, did putting the code in the link work for you?

-kaht

[small](All puppies have now found loving homes, thanks for all who showed interest)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top