Use JS variable to set the src attribute for [removed] tag

前端 未结 5 699
后悔当初
后悔当初 2020-12-10 10:11

I want to use a javascript variable as a \'src\' attribute for another tag on the same jsp.



        
5条回答
  •  醉酒成梦
    2020-12-10 11:05

    Are you able to use jQuery? If so you could use getScript():

    http://api.jquery.com/jQuery.getScript/

    $.getScript(mylink, function() {
       // do something using the JS that was loaded.
    });
    

提交回复
热议问题