Note that there are some explanatory texts on larger screens.

plurals
  1. POChrome console POST jquery 404 (Not Found) : jquery.min.js:2
    primarykey
    data
    text
    <p>Level: Newbie (JavaScript, jQuery, CodeIgniter)</p> <p>I make a function for change password, then I run it in localhost with chrome browser. I've got trouble when I want to call PHP function from my JavaScript. Chrome console said that the page is Not Found and the link for the document is jquery.min.js:2</p> <p>I don't know what I should do because I'm new with jQuery. Here's my html in pengaturan.html</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="width=device-width,initial-scale=1.0"/&gt; &lt;link rel="stylesheet" type="text/css" href="css/style1.css" /&gt; &lt;script src="jq/jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt; &lt;script src="jq/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;script src="jq/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;script src="date/js/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="date/js/kendo.web.min.js"&gt;&lt;/script&gt; &lt;script src="date/js/console.js"&gt;&lt;/script&gt; &lt;script src="jq/proses/set_ip.js"&gt;&lt;/script&gt; &lt;script src="jq/proses/newpass/newpass.js"&gt;&lt;/script&gt; &lt;script src="jq/proses/script.js"&gt;&lt;/script&gt; &lt;title&gt;edc - e diabet consult&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1 align="center"&gt;Pengaturan&lt;/h1&gt; &lt;p align="left" class="navigation"&gt; &lt;a href="settings.html" class="back"&gt; &lt;img src="ico/kembali.png"&gt; &lt;/a&gt; &lt;/p&gt; &lt;form id="form_pengaturan" action="post"&gt; &lt;p align="center"&gt; &lt;strong&gt;Password lama:&lt;/strong&gt;&lt;br /&gt; &lt;input type="password" name="pass" id="pass"/&gt;&lt;br /&gt; &lt;strong&gt;Password baru:&lt;/strong&gt;&lt;br /&gt; &lt;input type="password" name="newpass" id="newpass"/&gt;&lt;br /&gt; &lt;strong&gt;Konfirmasi password baru:&lt;/strong&gt;&lt;br /&gt; &lt;input type="password" name="confnewpass" id="confnewpass"/&gt;&lt;br /&gt;&lt;br/&gt; &lt;input type="button" value="Simpan" onclick="cek()" id="simpan" class="button"/&gt; &lt;input type="reset" value="Reset" class="button"/&gt; &lt;/p&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here's my javascript in newpass.js</p> <pre><code>/*Don't forget to add set_ip.js and jquery before you use this script in HTML page to make it work*/ var urlini = seturl(); var part= 'newpass/'; $(document).ready(function() { currentYear = (new Date).getFullYear(); $("#tgllahir_inp").kendoDatePicker({ // defines the start view start: "year", min: new Date(currentYear-50,'0','01'), max: new Date(currentYear-14,'0','01'), // defines when the calendar should return date depth: "day", // display month and year in the input format: "yyyy-MM-dd" }); }); function cek() { pass = /^([-a-z0-9_-])+$/i.test($("#pass").val()); newpass = /^([-a-z0-9_-])+$/i.test($("#newpass").val()); confnewpass = /^([-a-z0-9_-])+$/i.test($("#confnewpass").val()); var form_reg = $("input").val(); if(form_reg == "") { alert("Semua data harus diisi."); } else if($("#newpass, #confnewpass").val().length == 0 || $("#newpass, #confnewpass").val().length &lt; 5 || $("#newpass, #confnewpass").val().length &gt; 15) { alert("Terdapat kesalahan atau data kosong pada pengisian data.\nPastikan password Anda lebih dari 5 dan kurang dari 15 karakter."); } else if( !pass || !newpass || !confnewpass || $("#newpass").val() != $("#confnewpass").val()) { alert("Terdapat kesalahan atau data kosong pada pengisian data.\nPastikan password Anda sesuai."); } else { $.post(urlini+part+'cek', $('#form_pengaturan').serialize(),function(msg){ if(msg == '1') { alert("Data berhasil disimpan!"); window.location="index.html"; } else if(msg == '0') { alert("Password yang anda masukkan tidak benar!"); } }); } } </code></pre> <p>Here's my php controller (server side) in newpass.php</p> <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class newpass extends CI_Controller { function __construct() { parent::__construct(); $this-&gt;load-&gt;model('newpass_model','npmod'); } function cek() { $q = $this-&gt;npmod-&gt;pasien_pass(); echo $q; } } ?&gt; </code></pre> <p>Here's my php model (server side) in newpass_model.php</p> <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class newpass_model extends CI_Model { public function pasien_pass(){ $id = $this-&gt;session-&gt;userdata('id'); $pass = md5($this-&gt;input-&gt;post("pass")); $query = $this-&gt;db-&gt;where("iduser",$id)-&gt;get("user"); if( $query-&gt;num_rows() == 1 ) { $row = $query-&gt;row(); $oldpass= $row-&gt;password; if($pass==$oldpass) { $newpass = md5($this-&gt;input-&gt;post("newpass")); $confnewpass = base64_encode($this-&gt;input-&gt;post("confnewpass")); $data = array( 'password' =&gt; $newpass, 'passbit_user' =&gt; $confnewpass ); $this-&gt;db-&gt;where('iduser',$id); $this-&gt;db-&gt;update('user',$data); return"1"; } else { return "0"; } } else { return "0"; } } } ?&gt; </code></pre> <p>When I run it, Chrome console said that the page is Not Found and the link for the document is jquery.min.js:2 Do you have an idea what should I do?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload