0

I'm trying to get jQuery Intellisense working for my ASP.NET web-site (note, not web app) project. Below is where the scripts are referenced. There's no Javascript anywhere else on the page. - it's a test page, so it just has a few asp:labels.

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link rel="stylesheet" type="text/css" href="StyleSheets/StyleSheet.css" />
    <script type="text/javascript" src="Scripts/jquery-1.7.1.min.js"></script>
    <% If (False) Then%>
        <script type="text/javascript" src="Scripts/jquery-1.7.1.min-vsdoc.js"></script>
    <% End If%>
    <script type="text/javascript" src="http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js"></script>
</asp:Content>

This is the error I'm getting from Visual Studio:

Warning 25  Error updating JScript IntelliSense: C:\Users\spaton\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\HPBD331X\mqa.toolkit-fds90[2]..js: 'document.implementation' is null or not an object @ 23:99602  

If I remove the line that references the MapQuest API, the Intellisense works fine for jQuery.

I can't help but think I'm missing something simple / dumb, but I can't see it.

Visual Studio 2008 SP1 and KB958502 are installed.

Any advice?

Stewart
  • 153
  • 3
  • 12
  • Do you get this error if you remove the initial jQuery reference and leave the MapQuest reference? – CalMlynarczyk Oct 15 '12 at 03:48
  • Try adding another JavaScript tag in the dummy 'If' statement with the code `document.implementation = new DOMImplementation();`. It doesn't seem to recognize that a browser will initialize this property upon loading. This might trick it into recognizing the property. – CalMlynarczyk Oct 15 '12 at 04:19
  • No, same error unfortunately. Thanks for trying though! – Stewart Oct 15 '12 at 05:00

1 Answers1

1

I have managed to get around this issue. Not "solved" exactly, but I used an ASP.NET feature to move the problem.

What I did was remove the line referencing the MapquestAPI from the ASPX markup:

<script type="text/javascript" src="http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js"></script>

And then I had the ScriptManager add it for me.

Dim mapQuestAPI As String = "<script type=""text/javascript"" src=""http://open.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js""></script>"
ScriptManager.RegisterStartupScript(Me, Me.GetType(), "MapQuestAPI", mapQuestAPI, False)

Not pretty, but the end result is the page still works and now JQuery Intellisense works in Visual Studio 2008 as well.

Stewart
  • 153
  • 3
  • 12