javascript - adding script to my template dynamically - can I do it? -


can dynamically add/append javascript in script tags html template - reason need because user clicks on if user chooses provide education information in first place. thoughts? sorry if sounds confused confused.

var id_add_script = "#more_ed" + add_school_count;  var add_script = "$( id_add_script ).one('click', function() {$( id_add_script   ).hide().append(more_ed_degree_list).show('slow');});";  var add_script_withtags = "<script>" + add_script + "</script>";  $("form").after(add_script_withtags); 

why not execute code?

var id_add_script = "#more_ed" + add_school_count; $( id_add_script ).one('click', function() {     $( ).hide().append(more_ed_degree_list).show('slow'); }); 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -