Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. URL in action attribute is converted to page name only (for FireFox)......?

URL in action attribute is converted to page name only (for FireFox)......?

Scheduled Pinned Locked Moved Web Development
questionjavascripthelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AshishTijare
    wrote on last edited by
    #1

    I have a frame. I am creating a new form object in javascript. I have set action attribute to "TestMyPage.ashx" During runtime, FireFox converts action attribute to full url containing protocol, host name, virtual dir. name and page name. e.g.: "http://localhost:4768/MyApp/TestMyPage.ashx" It is expected that FireFox should load the url in action attribute on submit when it have the full url. But when I add the form object to frame, it converts the action attribute to "TestMyPage.ashx". I don't know what is causing this. Because action attribute now has page name only, it can not load the page (it do not have full url now). Code for FireFox:

    this.innerDocument = document.getElementById('MYFRAME').contentWindow.document;
    var \_form = document.createElement('form');
       \_form.id = 'MYFORM';
       \_form.name = 'MYFORM';
       \_form.method = 'post';
       \_form.enctype = 'multipart/form-data';
       \_form.action = 'TestMyPage.ashx'; //Here, at runtime, action attribute gives full url.
        this.innerDocument.body.appendChild(\_form); //Here, at runtime, full url in action 
    

    attribute is converted to page name only ...?.

    When this is done for IE, during runtime it shows full url in action attribute, so it loads the page successfully. But FireFox is converting url to page name in action attribute. Code for IE:

         var \_form = this.innerDocument.createElement('<form id = "MYFORM" 
    

    method="post" enctype="multipart/form-data" action="ImportHandler.ashx" />');
    var formHTML = _form.outerHTML;
    document.getElementById('MYFRAME').contentWindow.document.body.innerHTML = formHTML;

    Can anybody suggest what is the problem for such behavior. Any guesses are welcome. Thank you.

    Ashish Software Engineer, Pune

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups