Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website Design Forum


You are currently viewing our Website Design Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Applying a script to all pages?? Help please!
Old 11-04-2005, 06:53 PM Applying a script to all pages?? Help please!
Junior Talker

Posts: 4
Trades: 0
Hi all

I have a script that i would like to have on all of my pages but i have alot of pages so is there any software or anything i can do to apply it to all pages? i am using dreamweaver 7.0

Thanks
jammer2oo6 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-05-2005, 12:17 PM
sdcdesign.co.uk's Avatar
Extreme Talker

Posts: 198
Location: High Wycombe, Buckinghamshire, London
Trades: 0
If you've defined a site in dreamweaver, you could use the 'Find and Replace' function and do it for your whole site.

Say you wanted to add some javascript, you could find:

Code:
</head>
and replace it with :

Code:
<script language="javascript">
function code() {
   alert('here');
}


</script>

</head>


Obviously that probably won't be what you want to do but you get the idea....



Sean
__________________
[ Insert witty, yet highly intelligent signature here ]
sdcdesign.co.uk is offline
Reply With Quote
View Public Profile Visit sdcdesign.co.uk's homepage!
 
Old 11-08-2005, 02:06 AM
AndrewK's Avatar
Novice Talker

Posts: 13
Location: Sydney Australia
Trades: 0
Find and replace.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Design | Print | Broadcast Graphics | Free Video Tutorials
AndrewK is offline
Reply With Quote
View Public Profile Visit AndrewK's homepage!
 
Old 11-08-2005, 02:31 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
I think you want to a reference to the script on the pages, a search and replace is just more work if you have to change the script, plus it adds bulk to each of your pages, while the linked JS file will be cached.

Just put this code in the header (between <head> and </head>) of all the files that need to reference the code, and change "script.js" to the location of your script file:

Code:
<script type="text/javascript" src="script.js"></script>
and "script.js" is a plain text file with your JavaScript code in it. Then you only need to change and upload 1 file to update all the files with new JS code.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 11-08-2005, 05:59 PM
TrentonD's Avatar
Ultra Talker

Posts: 253
Location: Calgary, Alberta, Canada
Trades: 0
Or, if you are using PHP, you could use the following:
PHP Code:
include 'FILE.php'
(BTW, first post here )
__________________
Signature Coming Soon! :)
Please login or register to view this content. Registration is FREE
TrentonD is offline
Reply With Quote
View Public Profile Visit TrentonD's homepage!
 
Reply     « Reply to Applying a script to all pages?? Help please!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.56538 seconds with 12 queries