Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using JavaScript to pass the html from a frame to a form

    I am trying to use JavaScript and frames to allow someone to log into a website on another server in a frame off of a page coming from my server, navigate to a page on that server, and then submit, via a form that uploads the contents of that frame to my server for processing.

    I am mainly a PHP programer and a bit lost where it comes to JavaScript.

    The reason for this is the company I work for has introduced a web based scheduling program, at our location we need an hour by hour break down of staffing and their program does not offer this. I would like to be able to generate this without having the user save the html to a local file and then upload it to my server.

    Any ideas??

    Hitch

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,293
    Thanks
    10
    Thanked 583 Times in 564 Posts
    unless the framed page will allow you to run your own scripts on that page, you won't be able to easily do what you describe.

    javascript is not supposed to be able to cross frame coing from different webpages.

    one way around it would be to use a pop-up window instead of a frame.
    make sure you include the feature to display bookmarks.

    the user would then click a bookmarklet from the pop-up window, which injects javascript into the pop-ups document.

    all that would need to be done is:
    create a new form tag, method = POST, action=yourPHP page.
    add an input to that form.
    set the input value=document.body.innerHTML
    submit the form.


    this must be done using a bookmarklet, or the security limits will kill it.

    read up about these methods here.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •