2021年4月1日星期四

innerhtml while calling a id in the url- a better way?

the issue is doing this better since I was told this was a bad way to do this without explanation. The vid is not passed with the innerhtml method. But works with the window method

What is a better way to do this? I was told this is a terrible way and am having trouble passing the actual vid:

   document.getElementById('div1').innerHTML = ('<object style="height:100%" data=\"https://url.com/vendor?vid=\"'+data+'>');  

yet this

window.location.href = 'https://url.com/vendor?vid='+data;  

always works.

https://stackoverflow.com/questions/66913934/innerhtml-while-calling-a-id-in-the-url-a-better-way April 02, 2021 at 11:03AM

没有评论:

发表评论