The following is my code, i intend to use it as a bookmarklet.
javascript: (function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js');
document.body.appendChild(jsCode);
console.log("Everything is fine upto here!");
data = [["#txtApplcntName","test"],["#txtApplcntAdd","test"]];
console.log(data);
var obj = $.parseJSON(data);
for (var i = obj.length - 1; i >= 0; i--) {
var current = obj[i];
console.log(current);
$(current[0]).val(current[1]);
};
})();
Problems start when the actions in the for loop never take place. It gets even weirder when i can successfully log the variable obj and it logs, but when i do obj.length a null is encountered?
I am experimenting on Google chrome