Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 15th, 2006, 11:35 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Includeing JavaScript.

Hi,
I have a javascript on my folder. I want to include this file to my .aspx file i use below but not working.

-------------------
<script language="text/javascript" src="c:\inetpub\wwwroot\programmer\rupen\rm\dateti mepicker.js">
</script>
---------------------
Further, what if i don't want to give full path to my file? as by default it takes c:/WinNT/

Thanks in advance.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old February 15th, 2006, 01:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all you have to make sure that you understand how server-side programming and client-side programming works. ASP.NET is server-side and javascripting is client-side. The topic has been adressed a lot of times in this forum.

Enough said about that... If the path you are writing are correct the file will be included. However, you should - as you mention yourself - write the path relative to the document in which you put the reference. Say you have the script in a subfolder called mySubFolder relative to the document which are using the script, then the path would be...

mySubFolder\datetimepicker.js

I am betting that your problem is rather a misunderstanding about server/client-side concepts.

Hope it helps, Jacob.
 
Old February 16th, 2006, 05:32 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

okay, my whole application is in rm folder, and if i use rm/datetimepicker.js even that dosen't work..same for database.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
 
Old February 16th, 2006, 02:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

It should work; it should work relatively.

Brian
 
Old February 17th, 2006, 07:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Alright rupen, take this code and put in a file called test.aspx...
Code:
<%@ Page Language="C#" %>
<html>
<head>
    <script language="javascript" src="test.js"></script>
</head>
    <body onload="doAlert();" />
</html>
... and save it in a wab shared folder. Take the following code and put into another file called test.js and put it in the same folder...
Code:
function doAlert()
{
    alert("it works");
}
Now, look at the test.aspx page in a browser; it an alert box says 'it works', then it works.

Jacob.
 
Old February 20th, 2006, 09:37 AM
Authorized User
 
Join Date: Feb 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

i have included datetimepicker.js in my code
 everything is fine but wheni click on callender.gif .poup window comes but it is not showing calender.popup continuously shows busy cursor.

but the same code is working with firefox.
i know the reason is that window.open is there in js.
and aspx does not suppor that

could u help me out


 
Old February 22nd, 2006, 02:25 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Strange but now code is working.
I used below:
<head>
<script type="text/javascript" src="datetimepicker.js" ></script>
</head>

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript. Magxtopher Javascript 2 April 1st, 2014 09:27 PM
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
javascript rakri2007 C# 2005 1 June 25th, 2007 08:46 PM
"text/javascript" and "javascript" rupen Javascript 1 June 24th, 2005 07:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.