Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Question on PHP and scripts.

Options
  • 03-04-2015 4:02pm
    #1
    Registered Users Posts: 1,456 ✭✭✭


    I am just trying PHP and have a question I haven't managed to successfully search for.

    Why does PHP require scripts to be allowed for an option group with the onchange option set to "this.form.submit" to actualy submit the form when an option is chosen.

    Edit I've found the answer. onchange uses java script.


Comments

  • Registered Users Posts: 1,275 ✭✭✭bpmurray


    Do you mean JavaScript executing the submit? What has that to do with PHP? PHP is a server-side language which executes when it receives a message from a browser, but it has nothing to do with that's in the browser, apart from being a vehicle to deliver the DHTML.

    And if someone doesn't allow scripts, I'd say that's just tough - that was an attitude from 10 years or more ago. No script = no application.


  • Registered Users Posts: 1,456 ✭✭✭FSL


    Saying that blocking scripts = no application is absolute rubbish.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    bpmurray wrote: »
    And if someone doesn't allow scripts, I'd say that's just tough - that was an attitude from 10 years or more ago. No script = no application.

    What if a script breaks, as they tend to do?


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    FSL wrote: »
    Saying that blocking scripts = no application is absolute rubbish.

    Javascript would be a requirement for most modern web apps.
    Giblet wrote: »
    What if a script breaks, as they tend to do?

    I can't say I've spotted a general tendency for Javascript to just break.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    Graham wrote: »
    Javascript would be a requirement for most modern web apps.



    I can't say I've spotted a general tendency for Javascript to just break.

    So you've never had a script or code in general do something unexpected or a script fail to load? If any error happens during JavaScript parsing and eval, the rest of the scripts fail to load, you do know that right?

    The good news is most modern frameworks handle isomorphic JavaScript to allow for progressive enhancement, it's one of the reasons why React is so good.


  • Advertisement
  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Giblet wrote: »
    So you've never had a script or code in general do something unexpected or a script fail to load? If any error happens during JavaScript parsing and eval, the rest of the scripts fail to load, you do know that right?

    Did you read a different post to the one I posted?


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    Graham wrote: »
    Did you read a different post to the one I posted?

    Im not sure you understood what I meant then seeing as you replied to me. I wasnt talking about the language breaking itself but rather the scripts. I'll spell it out next time.


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Giblet wrote: »
    Im not sure you understood what I meant then seeing as you replied to me. I wasnt talking about the language breaking itself but rather the scripts. I'll spell it out next time.

    There's a rather unnecessary tone to your responses. It's coming across that you're upset by an imaginary reply where I asserted Javascript was bulletproof.

    I'm not suggesting Javascript is a perfect solution, I'm not suggesting Javascript is the best solution. I'm certainly not suggesting I've never had a script fail to load or do something else unexpected.

    Here's what I actually posted:
    I can't say I've spotted a general tendency for Javascript to just break.

    A very, very large part of the internet appears to agree as evidenced by the mass-scale use of Javascript.

    Of course it's still quite possible to browse without having Javascript enabled but on the most part that will result in a degraded user experience at best. I suspect that's what bpmurray meant by "No script = no application"


  • Registered Users Posts: 1,275 ✭✭✭bpmurray


    FSL wrote: »
    Saying that blocking scripts = no application is absolute rubbish.

    Not rubbish, just applies to about 90% of modern web apps. Offhand, I can't think of any that don't use JS, apart from the simple here-is-the-data static pages. Absolutely everything I produce today is responsive, interactive, customizable, etc., and that does require some fairly sophisticated JS (and CSS).


  • Registered Users Posts: 1,275 ✭✭✭bpmurray


    Giblet wrote: »
    What if a script breaks, as they tend to do?

    Of course there are bugs in JS code, just like in any other. That doesn't mean that you don't use it. Most compiled COTS programs have loads of minor (and not so minor) bugs - the decision is made to freeze the code and ship. As one project exec said before "we can fix the bugs or ship the thing, but not both".


  • Advertisement
Advertisement