9

I'm trying to call a html page like this with the Raspbian's default web browser and it leads me just to the default login-page.

Neither does it with Midori on the desktop.

When calling the exact same page with Firefox or Google Chrome on the desktop it just works.

In the first place I had

<body onLoad="doLogin()">

Which had the exact same behaviour, but worked on Firefox and Chrome. Is there anyway on getting this done with the built-in browser on raspbian?

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script>
<!--
function doLogin() {
document.form1.action="https://ip/sub/main.html?page=map_info&id=177";
document.form1.submit();
}
//-->
</script>
</head>
<body >
<form name="form1" id=form1 method="post">
    <input type="hidden" name="process" value="login">
    <input type="hidden" name="page" value="start">
    <input type="text" name="user" value="User">
    <input type="password" name="password" value="Pass">
</form>
<script>window.onload=doLogin;</script>

</body>
</html>

PS. User, Pass and the URL are changed to not expose internal data.

  • 2
    If you add "alert('hi');" in to your doLogin function does the alert appear? That will show if the JavaScript is running – rob Dec 4 '15 at 11:39
  • 1
    It does appear, unfortunately I did not find a solution until today. The Only thing not tranferred today is giving the user and password to the page. It won't login. At least the redirect works. The Function is called with both tries and works, but not the transfer of the userdata. – alsternerd Jan 7 '16 at 10:29
  • 1
    Maybe it's because you have your JavaScript code inside of the script tags wrapped in an Html comment – Mohammad Ali Jun 14 '16 at 17:17
  • 1
    That's to keep everything in one file, since two files seem too bloated for that case. I wasn't able to get the post/get-data correctly, so that's what I'd come up with. For now, I'm using vnc to login to the site, everytime the machine boots up. – alsternerd Jun 16 '16 at 13:48
  • 1
    check if the ID is with Quotation marks. ID="form1". could this work? in js change the submit to document.getElementById('form1').submit(); – Joe Platano Jul 8 '16 at 3:58
0

It is possible that the browser you are trying to use does not have JavaScript enabled on it.

  1. Open Opera
  2. Click on the Opera Button Opera Button at the top-left of the app window
  3. Click on the Settings menu item
  4. Click on the Websites item on the left window pane
  5. Under the JavaScript heading, you will see two options: To enable JavaScript: select the Allow all sites to run JavaScript (recommended) option
  6. To disable JavaScript: select the Do not allow any site to run JavaScript option
  7. You can also make exception rules, for instance: If you allow all sites to run JavaScript, you can make exceptions to disallow badsite.com If you disallow all sites from running JavaScript, you can make exceptions to allow goodsite.com
  8. When finished selecting your options, close the Settings window and restart Opera
  9. Visit: whatismyipaddress.ricmedia.com to confirm your current JavaScript status Opera web browser (official) Opera web browser at Wikipedia Search Google for Opera browser

This is from https://pchelp.ricmedia.com/enable-disable-javascript-opera/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.