Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

script src error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe - 21 Mar 2008 00:32 GMT
I have a script block in our page with the src set to something like this:
http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_html

The script seems to execute fine but IE shows a syntax error and FireFox
says invalid assignment left-hand side and points to the = in
pageName=index_html

Any idea what the problem could be?
Peter Bromberg [C# MVP] - 21 Mar 2008 02:12 GMT
What do you get when you enter this src URL into your browser and download
the content and save it on your filesystem? Is it  a legitimate block of
client script (without script tags)?
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net

> I have a script block in our page with the src set to something like this:
> http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_html
[quoted text clipped - 4 lines]
>
> Any idea what the problem could be?
Steven Cheng - 21 Mar 2008 08:50 GMT
Hi Joe,

As for the script returning by ASPX page, it should work correctly if the
page does write out the valid script text stream. How did you flush out the
script content via the page? here is a simple page code which I used to
test and it works well:

============================
protected void Page_Load(object sender, EventArgs e)
   {
       string siteName = Request.QueryString["siteName"];
       string pageName = Request.QueryString["pageName"];

       if( siteName == "MySite" && pageName == "index_html")
       {
           Response.ClearHeaders();
           Response.ClearContent();
           Response.ContentType = "text/javascript";
           Response.WriteFile(Server.MapPath("~/scripts/myscript.js"));
           Response.End();
       }
           //siteName=MySite&pageName=index_html
   }
===========================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Joe" <jbassking@noemail.noemail>
>Subject: script src error
>Date: Thu, 20 Mar 2008 19:32:38 -0400

>I have a script block in our page with the src set to something like this:
>http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_html
[quoted text clipped - 4 lines]
>
>Any idea what the problem could be?
Joe - 21 Mar 2008 16:34 GMT
Hi Steven

The issue is not with the page being called but with the page calling it.
For some reason both IE and Firefox complain about the script.
The script block looks like this:
<script type="text/javascript"
src="http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_html">
</script>

Did you try something like this?

> Hi Joe,
>
[quoted text clipped - 67 lines]
>>
>>Any idea what the problem could be?
Joe - 21 Mar 2008 16:59 GMT
There was a problem with the page being called. We put a Response.Write() in
that we forgot about and that was causing the error.

>I have a script block in our page with the src set to something like this:
> http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_html
[quoted text clipped - 4 lines]
>
> Any idea what the problem could be?
Steven Cheng - 24 Mar 2008 02:19 GMT
Thanks for your reply Joe,

So that's the additional "Response.Write" output make the page's client
html become invalid html document. Based on my local test, it also indicate
that the script reference code below is correct(should not cause client
browser error):

<script type="text/javascript"
src="http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_
html">
</script>

Anyway, I'm glad that you've resolved the problem.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Joe" <jbassking@noemail.noemail>
>References: <#Pbz2LuiIHA.6092@TK2MSFTNGP06.phx.gbl>
[quoted text clipped - 5 lines]
>
>>I have a script block in our page with the src set to something like this:

http://track.oursite.com/trackstat.aspx?siteName=MySite&pageName=index_html

>> The script seems to execute fine but IE shows a syntax error and FireFox
>> says invalid assignment left-hand side and points to the = in
>> pageName=index_html
>>
>> Any idea what the problem could be?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.