jquery - Undefined is not a function: while creating a form Javascript -
here linker.js
deps = ['jquery']; define (deps, function($) { var linker = { 'link' : function(ortholog,link) { $form = $.createelement("form"); $form.setattribute("method", "post"); $form.setatrribute("action", link); $form.setattribute("onsubmit" ,window.open(action+ortholog)); $('body').append($form); $form.setattribute("target","_blank"); $form[0].submit(); } //return linker(); } return linker; });
i undefined not function error after "form = $.createelement("form");" how can solve this? (this linker.js invoked javascript in software.)
why not...
deps = ['jquery']; define (deps, function($) { var linker = { 'link' : function(ortholog,link) { $form = $('<form>'); $form.attr({ method: 'post', action: link, target: '_blank' }).appendto('body'); $form.submit(function() { window.open(action+ortholog); }); $form.submit(); } //return linker(); } return linker; });
Comments
Post a Comment