Saturday, May 05, 2012 1:03 PM
I have a small script that just displays an alert. The alert does not display which tells me that placing a script in a CEWP is not enough. There must be some other code required to execute the script.
It works in SP 2010 but not in WSS3.
Tried using _spBodyOnLoadFunctionNames.push("show_alert"), that doesn't work either. Must be a 2010 thing.
One additional point... If I "view source", the script IS there.
- Edited by jd_hancock Saturday, May 05, 2012 1:16 PM
Sunday, May 06, 2012 9:56 AM
Monday, May 07, 2012 2:11 AM
It should works when you just write a script in the CEWP like this:
There must be some errors on your web page, the script will stop executing when some exceptions are thrown. You should fix these errors first. Sometimes the scripts SharePoint provided will also contain some errors, such as ActiveX control not installed. You can turn on the script debugging to find out the reason by clicking Internet Options->Advanced->Settings->Browsing, uncheck Disable script debugging(IE). You can also debug the page by using IE. Please use IE to debug the errors, some error can only reproduced by IE with SharePoint 2007.
You can also put the CEWP at the top of the page so that the alert can popup before some exceptions thrown in the middle part of the page.
TechNet Community Support
- Edited by Lambda Zhao Monday, May 07, 2012 3:13 AM
Monday, May 07, 2012 10:39 AM
Thank you both. Tried Firebug but the code was not executed. Set a breakbpoint but it's not stopping. No errors showed up in the status bar in IE however the IE9 status bar is not working that I can see. It never displays a "done" message or the progress bar.
The alert is just as you have it Lambda.
Monday, May 07, 2012 10:40 AMI probably need to test the page on an older IE version to see if there are any errors on the page since IE 9 is not ready yet.
I'll see if I can get a working version of IE to test it on.
Monday, May 07, 2012 11:08 PM
The IE9 developer tools don't work so I can't step thru the code. You can set breakpoints but the step options are inactive. Whenever page is refreshed, all breakpoints are deleted. I have script debugging enabled but no script errors display. Another IE9 bug.
Firebug cannot step into code either. Icons are visible but inactive.
If I could remove IE9 and go back to IE8 or a working version of IE, I could probably find the problem.
I will let my users know it's an IE issue.
Thanks everyone for the assistance.
Tuesday, May 08, 2012 6:06 AM
Tuesday, May 08, 2012 10:26 AM
It's just a debugger issue with Firefox and debugger issue with IE9 (and script error notification). The fact that SP2007 does not run scripts is something I can tell my users I will not be able to provide the solution they are seeking.(for now). I will need to see if i can get a IE7 machine to find the problem. It threw errors and notified me of the line causing the error.
Thank you for the thought.
- Edited by jd_hancock Tuesday, May 08, 2012 10:30 AM
Tuesday, June 05, 2012 3:29 PM
I am stumped right now. I have been searching forums on this subject but no one seems to have even figured out as much as I have, most likely because they don't have sites in 2 different DNS zones to test with.