Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript script src alternatives 1

Status
Not open for further replies.

pcrymble

IS-IT--Management
Jan 23, 2006
4
GB
hello

i have an external JS which I call using <script src="http:\...."></script>. It outputs a number of lines of text.

I would like to put this in a function and output the text form the function...so something like:
<script language="javascript">
function text{
load script here
add to variable
}
</script>

Anyone know how to do this?

Thanks so much
PC
 
I think you might need to be more explicit. My answer for you is: "Look in the *.js file, copy the function you want, and paste it into your page." However, if that were really the right answer, I think you would know it.

Do you have access to the code in the *.js file? (If you can include it in a page, then you should). Do you currently use that file by calling a function in it or does it just execute some JavaScript upon loading?

Oh, and: output to where? A section of a page? ...or the whole page?

Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
And what's up with the anonymity? Is the script that good that you can't show the source?
<script src="http:\...."></script>

It'd be a lot easier to answer your question if we could see the source code or had a link to your js file cause we have no idea what you're trying to stick in the function.

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
Ok!!!

Thanks - you guys are fun!

Ok - the script is
<script src="
I do not have access to it. Basically it writes out a bibleverse on a section of the page. Instead of doing that, I want to write it into a variable so I can manipulate it.

Hope that clarifies and thanks for the help..
Peter
 
The way that JS file is set up, it'd be easiest to grab it with server side scripting, strip off the document.write part, and write it on the page that way.

Since you didn't specify how you want to "manipulate" the text or formatting, I take it that you don't want to write the verse on your page in the format they have it in now.

Why don't you just write an array of the verses that you want, and use that in whatever format you desire, rather than scraping the other site for their code? There are a LOT of resources online for this, if you search using Google.

Lee
 
Surely you'd need to ask permission from the site before using their material, given that at the bottom of their site, they have a disclaimer:

That Site said:
. Scripture quotations are taken from the Easy-to-Read Version copyright © 2001 by World Bible Translation Center. [!]Used by permission.[/!]

After all, even works of fiction can be copyrighted!

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
thanks - I'll just search round for an easier way to do it..

Dan - the JS is provided by them as a free tool, but perhaps Ishouldn't be manipulating it...

Thanks for all the help

P
 
pcrymble said:
but perhaps Ishouldn't be manipulating it...
Well... you certainly don't want to be accused of playing God!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top