[removed] tag inside a javascript or jquery (in Sh

2020-03-31 08:05发布

问题:

At the moment I am coding in sharepoint(office 360), and I am having so many issues with the site considering that its my first week to use it. First of all when i tried to use a < script > tag in my codes, sharepoint seems to block this, and does not recognize my scripts. I know that there is a way to unblock the < script > tag, but I want to concentrate on the coding part.

OK, now to the issue, at the moment I am using every codes that I can gather to put < script > tags inside my javascript/jquery. I am putting my codes inside an onclick event, considering that the site does not allow me to use < script > tag.

I tried to use this:

<input type="hidden" name="new_workflow_doc_handler" onclick="<input type="hidden" name="new_workflow_doc_handler" onclick="$('#content').html('<script type='text/javascript'>alert('The script is running');<\/script>');">

this:

<input type="hidden" name="new_workflow_doc_handler" onclick="document.write('<script type='text/javascript'>alert('The script is running');<\/script>')">

this

<input type="hidden" name="new_workflow_doc_handler" onclick="var scriptString = '<script>alert('The script is running');</script>'; $(scriptString).appendTo('#content');">

Unfortunately all the codes i have tried was no success. and one of the big issues that I dont like about this is that when inside the onclick event I cant use double qoutes.

If you are wondering why I a want to put a < script > tag inside the javascript, as what I have said in the first place, sharepoint does not allow me to use < script > tags and I want to use script tag because I want to source something.

like this:

<script type='text/javascript' src='http://ntp-a1.nict.go.jp/cgi-bin/jsont'></script>

What syntax do i use to put a < script > tag inside my onclick event?

or is there other ways to "src" without using the < script > tag in javascript/jquery on an onclick event.

or is it possible, because sharepoint is kinda fussy when it comes to syntax coding. so many does and dont.