Hi!
Yesterday i was adding a new script file into a NewForm.aspx file.
I had a problem with this because when i added the <script> tag with the file reference src=”” it doesn’t works.
I found that i have to put that in a content but i want to do it adding the tag in the NewForm.aspx. Can i do it?
I don’t want do it writting the JavaScript code into NewForm.aspx, want to add the Scrpt REFERENCE.
Can you tell me about this?
I understand.
I think that when i modify some master page, somthing can crash. I had bad experiences with this haha
Thanks. Your replies were very good!
Reguards!
There is nothing wrong with modifying the master page as long as you are careful. What I usually do is this:
- Create a copy of the masterpage
- Modify it as I need
- From Designer: Right click and set it as the Custom Master Page and also select it as the default master page.
This way if something goes wrong, you still have your default master page un-modified that you can very easily go back to by repeating the steps above. Unfortunately I don’t know of any other way to inject JS files into SharePoint without creating custom solutions or adding Content Editor Web parts to EVERY page that you want it to occur.
Thanks for your reply again!!
In that article, I understand that i have to add a tag in master page (step 8). There is other way?
I want to add <script scr=”asdasd”/> tag in my .aspx file, but i don’t want to modify the master page, because is dangerous, you know.
That step is based entirely on the assumption you were in 2013. It’s a new feature of SharePoint that came out with that version that allows easier form customization. It is not available to you in SP2010.
If you follow the steps in the link I provided you should be ok.