Hi,
I have some issues to combine JavaScript.
I have a link within the SharePoint Navigation which I do not have access to the
<a></a>
tag. This the reason being that I created a link to aspx page with the JavaScript below.
So what happens is click the link, open the apsx page, onload the JavaScript fire. The JavaScript opens a modal window that allows the user to upload a document to a document library.
Currently my code will just click the link again and the modal popup will loop. So first of all I need to only click the JavaScript once. Then the user should be redirected to the page where the upload link was initially clicked. This should be something like this,
window.location.history.go(-1)
<a class="ms-addnew" id="idHomePageNewDocument"
href="http://site/Documents/_layouts/Upload.aspx?List={ListID}&RootFolder=&"
onclick="javascript:NewItem2(event, "http://site/Documents/_layouts/Upload.aspx?List={ ListID }&RootFolder=");
javascript:return false;" target="_self">Upload new asset</a>
<script language="javascript">
function go()
{
document.getElementById("idHomePageNewDocument").click();
}
window.onload = go;
</script>
I am not sure how to combine all of this code.
Please help!!