Skip to main content
Participant
June 20, 2017
Answered

Collect scripts in Dreamweaver for offline use

  • June 20, 2017
  • 2 replies
  • 486 views

Hi community,

i've coded a Virtual Reality application in Dreamweaver and used many online scripts.

Now i need to present this project offline. How do i download all linked scripts automatically?

Is there also a function to replace the links then in my code?

Thank's!

Best regards,

Julian

This topic has been closed for replies.
Correct answer Jon Fritz

There's no automatic function for this in DW that I've ever seen (it could be hidden somewhere I've never looked), unless they're on a server you control (Get function). You'll just need to go to the sites where the scripts exist and copy them into new .js files in DW, then link to them. Comment out the real script links and add new links to the local copies...

<!-- <script src="www.external.com/script.js"></script> -->
<script src="local/script.js"></script>

Then when you're done with your offline preview, just take out the comment tags and local script links.

2 replies

Rob Hecker2
Legend
June 20, 2017

If all the remote scripts are in the same location and therefore have the same initial path, then there would be a way to do this. If you had considered this issue before you built this project, it would have been easier to deal with.

You don't tell us if you are using a database, PHP, or what languages. What kinds of scripts are these? Are you using an Apache local server during development?

What you want to do is determine what is different between the local environment and the remote environment, and use that to create a conditional. For instance, if the remote environment uses SSL, you might do something in PHP like this:

if($_SERVER['SERVER_PORT'] != '443') {
// SSL is not used, so it must be the local environment
$root_path_to_scripts = "http://localhost/";
} else {
$root_path_to_scripts = "https://remotehost/";
}

. . .but if the scripts are not in the same path, you would have to write a conditional for each script, which is sloppy and would be timeconsuming if you have many scripts.

EDIT: After I posted my response I saw Jon's. That's probably the approach to take.

Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
June 20, 2017

There's no automatic function for this in DW that I've ever seen (it could be hidden somewhere I've never looked), unless they're on a server you control (Get function). You'll just need to go to the sites where the scripts exist and copy them into new .js files in DW, then link to them. Comment out the real script links and add new links to the local copies...

<!-- <script src="www.external.com/script.js"></script> -->
<script src="local/script.js"></script>

Then when you're done with your offline preview, just take out the comment tags and local script links.