Current location: Hot Scripts Forums » General Web Coding » JavaScript » [SOLVED] View Source


[SOLVED] View Source

Reply
  #1 (permalink)  
Old 06-15-08, 11:05 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
Post [SOLVED] View Source

Since looking through documents about the security concepts of hiding javascript code I found that it is impossible as the client side needs to have this code to run. Makes sense...

I am currently using Ajax to embed a lump of code into my page. The problem is that I need to debug this code and when I right-click view source in firefox 2 I cant see the code dump. The code shown is the original code before the Ajax kicks in. How do I view the latest source that the browser is working with?

Or is this now seen as a perfect security option for protecting your scripts?


Thanks
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Reply With Quote
  #2 (permalink)  
Old 06-15-08, 11:50 AM
Clueful Clueful is offline
New Member
 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by DAL View Post
.

I am currently using Ajax to embed a lump of code into my page. The problem is that I need to debug this code and when I right-click view source in firefox 2 I cant see the code dump. The code shown is the original code before the Ajax kicks in. How do I view the latest source that the browser is working with?
You could copy the script block into a hidden textarea which you later display, or perhaps alert the innerHTML of the script block.
Reply With Quote
  #3 (permalink)  
Old 06-15-08, 12:28 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
If you install the Web Developer toolbar extension for FF, you can choose "Web Developer" -> "View Source" -> "View Generated Source" to see the source in it's current state. Web Developer also comes with DOM Inspector, giving you full access to every object and property live in the DOM.

You can also use the Firebug extension, which is awsome for debugging, to see the source and edit it live in a tree-like view, or as plain text. Firebug includes tons of useful other utilities, like a JavaScript debugger and traffic analyzer.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
  #4 (permalink)  
Old 06-15-08, 04:25 PM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
Clueful - Thanks for your response. I already thought about that but it would have been a little tricky. I kinda wanted the other question as to how you actually view the generated source code aswel. Thanks for taking the time to suggest it though.

TwoD - Thanks, just what I was looking for. Ill go check out Mozillas website now.
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OutOfMemoryError utd Everything Java 1 10-01-11 06:19 AM
Desable view source menu and right click on mouse - help needed scscosta JavaScript 2 03-27-06 01:20 AM
Disable the Source link in View menu mohank JavaScript 3 03-31-05 10:37 PM
Can't run as applet... JPortal Everything Java 0 09-24-04 09:49 PM
View Source of an web page dihan PHP 9 07-07-04 06:02 AM


All times are GMT -5. The time now is 11:39 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.