Calling Different Functions In An External .js File

I am trying to clean up my html pages by removing the very simple (copied and pasted) javascript functions and placing them in an external file.

What is the correct syntax to call function f1 in function.js ?
Also can I add asp code in function.js and call it from an html page?
I have this code in my html page that is not working properly :

<font face="Verdana, Arial, Helvetica" size="2">Today's date is: <font color="#ff0000"><%response.write(date())%>.

View Replies


ADVERTISEMENT

Calling External Sub

Im wanting to call a sub funvtion on another page from vbs that is:

<SCRIPT LANGUAGE=vbscript RUNAT=Server>
sql="exec SomeStoredProc"
call DoConnection(sql)
Response.write(recordset.getstring)
call DBClose()
</SCRIPT>

the DoConnection sub is in another page called MyDBConnection in a folder call Common.

I know that I can use serverside includes and embed my con in the page using <%%> but I want the use runat server How can I make call to a function in an external page?

View Replies View Related

Calling Functions...

Where's the best place for me to include all my functions that I want to call throughout different pages? Should I just put them all in one ASP file and include that page on every page? Or use global.asa somehow (how??)?

Anyways, I was just wondering because I didn't want to slow things down if I could help it (I didn't know if having another big file attached to every page when I'm just using a small portion of it was very effective or not)

View Replies View Related

Using Functions With Parenthesis And Calling Them?

ok i have this function

if blah blah then
runcode(in)
end if

if blah blah then
runcode(out)
end if

function runcode(variable)

sql = select * from tblitem where id=" & variable & ";"

I assumed that would work but it doesnt work properly as the variable seems to be empty.
Any ideas what im doing wrong maybe in ouw i call it?

View Replies View Related

Calling Functions Within A Web Service

My first problem is: I am having an issue when using a web service. The web service is written by another department and say its running fine but when I call it, I sometimes I get a system.net.webexception return instead of the correct return. Would anyone have any advice or suggest any extra debugging I could do to find out where this problem might occur?

The second problem I am having is: I also called some functions within the web service over GPRS and sometimes the function just hangs. The only way I have found to get the function call to work again is to disconnect the GPRS connection and reconnect it. However other functions and other programs are still using the GPRS connection quite happily.

View Replies View Related

Trouble Calling Functions

I'm having a little bit of trouble.I have created a form where I accept peoples information.at the bottom of the form I have a submit button that I want to have execute a function or procedure that I created in VB script.the problem I have is that it execute the function even before the client has clicked on Submit.

View Replies View Related

Question About Calling Functions

If I have an asp page and I defined a vbscript function in that page. Could I use a button will execute that function and spit out the results within the same page.

I don't want to define a vbscript in an html page and then call an asp page through <form action="default.asp">

I want the button and results on the same page.

View Replies View Related

Drop Down Box External File

how can you make a drop down box from an external file?

View Replies View Related

Connecting To External Xml File

i am trying to write a script to parse an external xml file, but am having
problems... the problem i think has to do with me trying to do
Response.Write(xmlDoc.transformNode(xslDoc)) before the xml is fully loaded.
The link to the xml file is valid. Code:

View Replies View Related

Parse An External XML File

I have a site that pulls in XML data from an external third party and I need to parse it in my ASP page.

Could someone please suggest examples or online resources where I might learn how to do this? Everything I am Googling is confusing me with DTDs, XSLTs etc.

View Replies View Related

SubFunction In External File

Is it possible to store subfunctions in an external file and then include that file ASP files requiring use of its contents?

View Replies View Related

Prompting A Download Of An External File In ASP.

I'm trying to create an ASP page which, when it loads runs the ASP code
first then prompts the user to download a text file. I know the answer
might be obvious to some of you, but I've sone several searches online
and I'm not getting anything.

1) Run code in ASP page.

2) Prompt user for download of external txt file after code is finished
running.

View Replies View Related

Database Password In An External File

I would like to know something about placing a password for a database in an external file, something like a global.asa file or a included file. I'm using an access database and ASP. how do I make this file and how do I attach it to my website. I thought this might be useful for extra database security, is this true?

The database is located in a folder that is protected by the hosting provider and you can only download the database using a login name and password and you can change data trough webpages (update, delete and insert).This has all about database security, I want to make my database as secure as possible, I'm already using SSL certificates.

View Replies View Related

Functions In Include File

I have an Intranet that I have developed which uses
templates and all ASP functions in separate included ASP
files.

For instance, functions.asp gets included in each page and
does some of the following:

- ensures users are logged in
- defines date functions
- contains many functions used by various pages that call
the include

The functions.asp file is about 15k. Is it expensive on
the server to include that in each asp file called by the
server even though only say 4 of about 35 functions may be
used by that particular page. I.e. I have a function that
takes address information and creates an html formatted
address block. Obviously that is only used on pages with
an address but it gets 'included' in every page.

View Replies View Related

Calling A .exe File

i am doing my final year project ...and i wanted to know that

"IS THERE A WAY TO CALL AN EXE FILE FROM AN ASP PAGE ????"

View Replies View Related

Calling ASP Variable To Another ASP File

I have two asp files. I would like to call a variable from one of the asp files to another one.

first.asp file activated it has the following variables that I want called by other files.

demoName="Test demo"
salesPersonEmail="first.last"
specificURL="testURL"

The other asp file should be able to call on this information, and then place it in various areas.

View Replies View Related

Calling A DLL That Writes A File From ASP

I call a DLL that writes a file. The DLL is written in VB and it behaves correctly when called from within VB. When I call it from ASP, it generates no errors, returns the correct results but does NOT create the output file. The virtual directory of the page from which I call the DLL has Write permission.

View Replies View Related

Calling A Batch File

I'm trying to call a batch file that I've built using the FileSystemObject and CreateObject("Wscript.Shell"), oShell.Run. in an asp script. Naturally, I can get the script to work from a command line but not from abrowser. The page does not throw an error but the oShell.Run. portion of the script doesn't run.

View Replies View Related

External Xml

how do i include an external xml file, i take it i cant use <link> like with stylesheets.

View Replies View Related

Can I Combine ASP With External CSS?

I am trying to display a random background image for a webpage. I found this code to do it

<%
'Defines the number of background images you have
Const NUMBER_OF_IMAGES = 2

'Initiates the randomize function
Randomize

'Sets a variable: this will be used to hold the
'random generated value
Dim intImageNumber

'This is where we create the random number
intImageNumber = Int((NUMBER_OF_IMAGES * Rnd) + 1)
%>

Modify the body tag to accept the random number. In this case we are going
to place it within the image so as to facilitate the selection of a random
image. Code:

View Replies View Related

External Script

Is there any way I can link to a EXTERNAL (on a different server) VBS script or a include file in an ASP document??

View Replies View Related

External Database

I would like my localhost website to connect to a Access Database on the web.Is this possible and if possible how do I do it?

View Replies View Related

External VBScript

Is it possible to run an external VBScript in an ASP page. ie. A VBScript that will run on it's own outside of ASP.

I have a VBScript that performs a function,there is no user I/O. I want to use this script both on it's own and from within an ASP page.

View Replies View Related

Cookie Via External ASP Page?

I have 3 domains, A, B, and C.

I want to put the same JS tag on sites A and B that call an asp page on domain C.

The tag would look like this:
<script language="JavaScript1.1" src="http://secure.C.com/Demo/Intercept.asp"></script>

The ASP page on domain C would write a cookie, in theory the cookie should have permissions for read and writing from site C.
Something like this:
Response.Cookies("Name").Expires = Date() + 365
Response.Cookies(SurveyName).Domain = ".C.com"
Response.Cookies(SurveyName).Path = "/"

In firefox the result is exactly as planned, a cookie is set when a user goes to sites A or B via site C, and using this same approach, I can read the cookie from domains A and B via the JS tag calling the script on site C.

IE does not like this. Sometimes it doesn't even write the cookie, other times the cookie has to be there b/c of resulting actions taken, but when viewing the list of cookies, it's no where to be found. Additionally, I don't seem to be able to read the cookie the same way as firefox is letting me.

I know this can be done, I went to foodnetwork.com (yeah I love to cook), and saw that they were using a metric service that was calling a back end script from the vendors domain, and setting a cookie from that vendors domain, all without the user seeing anything or leaving the foodnetwork.com domain. I've looked at the resulting JS code that is returned from these vendor back end pages, and it has nothing to do with the cookie being set, it's definitely happening server side.

View Replies View Related

Searching An External Website

I have multiple websites on my Intranet. My current search engines can search within their own environment. However, I would like to have one search page, which retreives results from all environments.

My first task is to connect, retreive and display results from a second server (through http). Then I will need to scrub the results to display in a unique template.

View Replies View Related

Customising External .js Files

can you use asp to customise external js files e.g.

<script src="fred.js"></script>

where fred gets the page id and changes an image in the .js file to sui....

View Replies View Related

Include From External Server

I'm looking for a way to include a file from another server in asp page.using #include won't work because it's not on the same server. In php, you can simply include(), and it doesn't care whether or not it's on the same server, is there a similar function in asp?

View Replies View Related

External Viewer Application

i have an asp page to list the result of search page.when i click on a link(href) , which is a 3D CAD file located in a directory ,it should be opened in a new page.This page shld support a 3D cad viewer in built in it.how to inbuild a CAD viewer in the HTML page?and view the link in that page

the code goes like this :

<TD> <a href ="prev.html" target = "new window"> <%=Rs(k).Value %> </TD>

This Rs(k).value is a link to the 3D file (eg. "C:Directoryfile.dwg").When this file is clicked,the value of Rs(k).value has to be passed to the "prev.html" page and the file must be opened with "3D file viewer".How to inbuild the CAD viewer into my HTML page and how to pass the Rs(k).value to that page?

View Replies View Related

Load External Web Page

I want to load a web page from another server via http into an array or variable, parse it, and pull some data using plain ol ASP / VBScript.an example page to pull:

http://sports.espn.go.com/mlb/players/profile?playerId=4245

I search quite a bit for this info but so many results and not enough knowledge in this area of ASP.

View Replies View Related

External Data Acessing

i need to create a site with a feed back system. one of my friend said to me ASP has nothing to do with this project. is it possible to do this using ASP ?if yes then what r the major functions that i should use.

View Replies View Related

Import From External Source

My company recently hired a third party to handle phone orders during off hours. The third party wants to be able to update our database through their own interface. We are running SQL Server 2000 on Windows 2000 Server with ASP.NET 1.1. The number one thing that come to mind is security for credit cards. Perhaps some kind of web service, xml, etc.? Does anyone have any suggestions on the best way to handle this?

View Replies View Related

Send External Email

I have an .asp page sitting on the intranet that I want to, when necessarry, send emails to people. All my code is fine, no errors whatsoever however, if the person to be emailed has an EXTERNAL email address they receive an email form my system fine BUT if my user has an INTERNAL email address they are not receiving mail from my system.

View Replies View Related

Output From External Webpage

a way to read an output from an external webpage/service? For example;

The external source is on http://serverA:6010/sendoutput This page displays one line of outputted text, I want to be able to read this in an asp page into a variable.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved