开发者

IE8 error when loading web page

开发者 https://www.devze.com 2023-01-02 02:14 出处:网络
I am helping to m开发者_StackOverflow中文版ake improvements to a SharePoint 2007 page that someone else has developed.This stuff is pretty new to me, so please forgive me if this is a noob question.

I am helping to m开发者_StackOverflow中文版ake improvements to a SharePoint 2007 page that someone else has developed. This stuff is pretty new to me, so please forgive me if this is a noob question.

When I load the page in IE8, I get the following error:

Message: Object doesn't support this property or method
Line: 159
Char: 2
Code: 0
URI: <blah>/Pages/default.aspx

(Note that I replaced the beginning of the URI with <blah> to make it more generic.)

When I view the page source, the following is on line 159:

$("body *").replaceText( /Welcome\s(\w+)\,\s(\w+)/, "$2 $1");

Does this look valid? (Or, am I totally clueless and looking in the wrong place?)

Edit:

Apparently, replaceText is provided by Ben Alman as free plug-in.

I found the following in my page source, so I'm assuming that I am referencing the plug-in correctly. I was able to download the "jquery.ba-replacetext.min.js" successfully. Maybe I'll check it to see if anyone modified the source and introduced a bug.

<script type="text/javascript" src="/_layouts/<blah>/jquery.js"></script>
<script type="text/javascript" src="/_layouts/<blah>/jquery.ba-replacetext.min.js"></script>

Edit 2:

It appears that this is not an issue in Firefox or IE7. I noticed that we are using jQuery 1.3.2. It's possible that this is resolved in the latest version of jQuery. If this is the case, I will post that here.

I sincerely appreciate all the help with this issue. Thank you all very much!


Does the same error happen in other browsers, most of which have better debugging facilities? When you break on that line in the IE debugger, can you figure out by inspection/watch what's null when it shouldn't be?

Better yet, can you make the change from "Welcome LastName, FirstName" to "Firstname Lastname" in the code on the server, rather than munging it on the client?


If the line you posted is accurately the source of the error, I would say there's a problem with how jQuery is included. Your error message says "char: 2", which is $(. Is jQuery used successfully prior to this line?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号