www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 12-17-2003, 10:25 PM
    druss druss is offline
    Registered User
     
    Join Date: Jan 2003
    Posts: 72
    cannot get html by using document.innerHTML

    i am getting no errors from the javascript however i still cannot use the html that is extracted by using then document.innerHTML method.

    i have a page that decrypts a javascript encryption that i am using, so far i am able to decrypt and even write the output in another fram however i cannot get the html source code in an iframe one the same page as the decryption script. the page in the ifram is not a third party page.

    so far this is where i think its going wrong:

    PHP Code:
    var counter = document.frames['test'].document.innerHTML;
    function
    decryptform() {
    encryptedsource = decrypt(counter, "`", "78")
    it works fine when on the page in the 'test' iframe has the following content

    PHP Code:
    <script>window.top.decryptform('9834756383479')</script>
    however then the main script page must be changed to the following:

    PHP Code:
    function decryptform(counter) {
    encryptedsource = decrypt(counter, "`", "78")
    could someone please tell me where i am going wrong while trying to get the html from the page in the 'test' iframe and put it in the variable counter.

    also the html in the iframe is a single line.

    i am sorry that i cannot post the actual whole script but it is far too large.

    Thanks
    Goran
    Reply With Quote
      #2  
    Old 12-17-2003, 10:27 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    Try using document.body.innerHTML instead.
    Reply With Quote
      #3  
    Old 12-17-2003, 10:32 PM
    druss druss is offline
    Registered User
     
    Join Date: Jan 2003
    Posts: 72
    nup, no luck.

    i tried changing it to:
    document.frames['test'].body.innerHTML;

    and to:
    document.body.frames['test'].innerHTML;

    any other way??
    Reply With Quote
      #4  
    Old 12-17-2003, 10:34 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499

    document.frames['test'].document.body.innerHTML;
    Reply With Quote
      #5  
    Old 12-17-2003, 10:38 PM
    druss druss is offline
    Registered User
     
    Join Date: Jan 2003
    Posts: 72
    sorry, still nothing.....

    could it be that it is getting the code but just not writing it out?? or is there another way??

    thanks alot for your help
    Reply With Quote
      #6  
    Old 12-17-2003, 10:41 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    You're welcome. Try this:
    Code:
    alert(document.frames['test'].document.body.innerHTML);
    Reply With Quote
      #7  
    Old 12-17-2003, 10:46 PM
    druss druss is offline
    Registered User
     
    Join Date: Jan 2003
    Posts: 72
    hmmm, no alert message comes up at all, nor does an error??


    i thought maybe you would need the iframe line i used

    Code:
    <iframe src="test.htm" name="test"></iframe>



    ok when i modified it and changed the code to the following i got the alert and it said undefined
    Code:
    <iframe src="test.htm" name="test"></iframe>
    <script>alert(document.frames['test'].document.innerHTML);</script>

    Last edited by druss; 12-17-2003 at 10:52 PM.
    Reply With Quote
      #8  
    Old 12-17-2003, 10:51 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    See attachment.
    Attached Files
    File Type: zip iframe.zip (384 Bytes, 327 views)
    Reply With Quote
      #9  
    Old 12-17-2003, 10:55 PM
    druss druss is offline
    Registered User
     
    Join Date: Jan 2003
    Posts: 72
    ok, it worked. thanks alot


    Goran
    Reply With Quote
      #10  
    Old 12-17-2003, 10:59 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    You're very welcome.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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
    Forum Jump


    All times are GMT -5. The time now is 03:28 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.