How to use JSFiddle (JavaScript, HTML, Firebase)? -


i want use jsfiddle make easier provide through stackoverflow.

i try add following code:

<form method='post' action='' onsubmit="return onformsubmitted()">     <input type='text' name='leerling' id='leerling'>     <input type='text' name='opmerking' id='opmerking'>     <input type='submit' name='submit' value='send'> </form> 

with javascript code:

function onformsubmitted() {     event.preventdefault();      var ref = new firebase("https://mydatabase.firebaseio.com/");     var _leerling = document.getelementbyid("leerling").value;     var _opmerking = document.getelementbyid("opmerking").value;      var postsref = ref.child("opmerkingen");     var newpostref = postsref.push({         leerling: _leerling,         opmerking: _opmerking     });      var postid = newpostref.key();     var leerlingref = ref.child("leerling").child(_leerling);      leerlingref.once('value', function(snapshot) {          if( snapshot.val() === null ) {             /* not exist */              var leerlingnummer = _leerling.substring(0,6).trim();             ref.child("leerling").child(leerlingnummer).set({                     "naam": _leerling.substring(7,33).trim(),                     "klas": _leerling.substring(34,38)             })             ref.child("leerling").child(leerlingnummer).child("opmerkingen").push({                 "opmid": postid             })          } else {             var leerlingpostref = snapshot.ref().child("opmerkingen");             leerlingpostref.push({"opmid": postid});         }     }); } 

and added external library: https://cdn.firebase.com/js/client/2.2.1/firebase.js

to begin with: closing -tag marked red in editor. furthermore when running it, entering values 2 fields en clicking send following message:

{"error": "shell form not validate{'html_initial_name': u'initial-js_lib', 'form': , 'html_name': 'js_lib', 'html_initial_id': u'initial-id_js_lib', 'label': u'js lib', 'field': , 'help_text': '', 'name': 'js_lib'}{'html_initial_name': u'initial-js_wrap', 'form': , 'html_name': 'js_wrap', 'html_initial_id': u'initial-id_js_wrap', 'label': u'js wrap', 'field': , 'help_text': '', 'name': 'js_wrap'}"}

although code runs fine. missing on how use jsfiddle?

for closing tag, jsfiddle looks formed html document, in case not, since tags not closed, why tag has erroneous closing tag, try close input tags , should resolved:

    <input type='text' name='leerling' id='leerling' /> 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -