I have a problem submitting my "form" with json. It is not a traditional form,
= "Snippet-code-js lang-js prettyprint-override">
$ ('# select'). ('Change', function {document.getElementById ("info"). Set attribute ("data-information", this.value);}) $ ('# info'). ('Click', function) {var id = $ (this) Data ('info'); Add (notification);}); Add Function {$ .ajax ({type: 'get', cache: false, contentType: content_type, beforeSend: function (xhr) {xhr.overrideMimeType (content_type);}, data: {'action': 'info_add ',' Info ': info}, url: Sitthid +' info / all ', success: function () {update ();}}); } & lt; Script src = "https://ajax.googleapis.com/ajax/libs/JQuery/1.1.0.0/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Select ID = "Select" & gt; & Lt; Option value = "1" & gt; Data 1 & lt; / Options & gt; & Lt; Option value = "2" & gt; Data 2 & lt; / Options & gt; & Lt; Option value = "3" & gt; Data 3 & lt; / Options & gt; & Lt; Option value = "4" & gt; Data 4 & lt; / Options & gt; & Lt; / Select & gt; & Lt; Div id = "info" & gt; Button & lt; / Div & gt; So as you see, when selected, this adds "data-information" attribute for div and when the div is pressed So it sends the data-data to the php script. And the problem is that it always sends the same value, but after refreshing it only sends it once and then again the same value as before. It's hard to interpret but the example is here: I think I select "Data 2" and press on the div. It sends "2" but when I change it to "data 3", and press it on the div, it still does not send "2", "3". Sorry for any cash set or nothing bad english and thanks in advance :)
If you If you are also going to use jQuery for settings, then read it with jQuery
Change
document.getElementById ("info"). SetAttribute ("Data-Information", this.value); to
$ "# info"). Data ("info", this.value); Still wondering why you are using data attributes, when you are not just reading the price on demand.
Add ($ ('# select') Val ());
Popular posts from this blog
I am trying to learn PDO, now I have written this small code, but it gives me a serious error: Fatal error: Call a member function at a non-object dot () ... $ con = new mysqli ("127.0.0.1", "root", "", "csvdangercheck"); $ Query = $ con- & gt; ("Id,` var1`, `var2`) values (" id,: var1,: var2) ";); $ query- & gt; bypass pattern (': id', $ id); $ query- & gt; BindParam (': var1', $ VAL1); $ Query- & gt; bindParam (': var2', $ val2); $ Query-> Executed (); I Trying to use print_r ($ con-> errorInfo ()) but Fatal error: Undefined method mysqli :: errorInfo ( ) ... can someone tell me what am I missing? Flaffeh said, you have PDO Missing Mysqy, try it: $ con = new PDO ('mysql: host = 127.0.0.1; dbname = csvdangercheck', 'root', '');
I have a 6 digit number and a 31-digit number (such as "234536" and "201103231043330478311223582826") that I The API needs to be crawled in the same 22-character alphanumeric field that uses PHP. I tried to convert each one to 32 (using custom code could not handle the base_convert () large number) and to connect with a single-character delimiter, but It only gives me 26 characters This is a restore API, so the letters should be URI-protected. I would like to do a database table cross with two references without reference to another reference value, if possible, any suggestions? Instead use a radix of 62. This will give you 22 characters for the top, 3.35 for the pre and 17.3 for the next. & gt; & Gt; & Gt; Math.log (10 ** 6) /math.log (62) 3.3474826039165504 & gt; & Gt; & Gt; Math.log (10 ** 31) /math.log (62) 17.295326786902177
For a specific set of tasks, I need to log in to the incoming request inputstream as well as outgoing response. is. I am using an ActionFilterAttribute for this and overriding the OnActionExecuted and OnResultExecuted methods. So I'm starting with this idea ... Public category ActionLoggerAttribute: ActionFilterArrbit {Public Override Zero On-Offed Execution (ActionActioned Contact Filter Filter) {base.OnActionAxecuted (FilterContext); HttpRequestBase request = filterContext.HttpContext.Request; // TODO: Log the request. InputStream} Public Override Zero OnResultExecuted (ResultExecutedContext FilterContext) {base.OnResultExecuted (filterContext); HTTPRPSPointBase Response = FilterContacts Hpptex response; // TODO: Log on Response.OutputStream}} Ideally I'll hook it up with enterprise library logging because I'm already using it for error logging. Am I reaching the input and output stream at the right time? Can I easily use the Enterprise Library to log i...
Comments
Post a Comment