how do i pass parameters into an external jScript using jQ?
i was able to get this working fine:
<script
id = 'myScript'
data-myParm =' my value'
src = './myScript.js' >
</script>
myScript.js:
document.getElementById('myScript').getAttribute('data-myParm')
but i thought i had seen a very easy (and better) way to do it using jQuery, and not using a script id. also i would prefer not to use anything like
<script src='./myScript.js?myParm=my%value&'> </script>
i tried something like $.data('myParm') and $('script').data('myParm') with no success.
suggestions?
a very easy (and better) way to do it using jQuery... using jQuery is not necessarily "better" than using vanilla javascript.