Inside my JavaScript I have the following variable:
url = A + 'abc/' + B + '.test';
A & B are the variables. when I am doing alert(url); I am getting the correct URL. I want to pass this url variable in the object.
<object style="width:100%; height:100%;" data="(URL as variable)"></object>
- How should I pass the URL as variable?
Is it possible to call javaScript function on
data="someFun()"?function someFun(){ url = A + 'abc/' + D + '.test'; }
and then
<object style="width:100%; height:100%;" data="someFun()"></object>
- If yes, which approach is better passing variable or calling a function in case of URL ?