Converting from NATIVE to IFRAME sandbox

后端 未结 1 1199
一个人的身影
一个人的身影 2021-01-24 00:07

I have a large application that I want to convert from NATIVE to IFRAME sandbox now that NATIVE is deprecated. The general flow of the application is as follows: The user fills

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-24 00:58

    There is no point in ever using a button of the "submit" type, unless you want to force the form to make an HTTP Request, and reload the application. That's what a "submit" type button does. It causes the page to be reloaded. The "submit" type button is meant to work together with a form in a certain way. It causes a GET or POST request to happen. That's what the problem is. So, you'll need to reconfigure things a little bit.

    Just use a plain button.

    
    

    I created a gotoPg2() function to test it:

    
    

    If you use that, they you don't need the $(document).ready(function() { etc. code anymore. And, if you don't need that code, then you don't need to load jQuery.

    Unless you are using jQuery for other things, then you don't need:

    
    
    

    The NATIVE mode was probably blocking the intended usage of the "submit" request. That's why the code in NATIVE was working. IFRAME allows things to work as they are built and intended to work, which means that the page was probably trying to be reloaded, and an error was occurring. I was getting a 404 page error in the browser console.

    0 讨论(0)
提交回复
热议问题