29 Replies Latest reply: Apr 24, 2013 12:38 PM by ionara17 RSS

    Javascript does not work when I move files to another drive

    ionara17

      I have a website that as an imbedded swf file created in Flash Builder. The html has a javascript code that controls the size of a table. Depending on how big the table is the website''s height increases or decreases. However this javascript only works when the files are in the D drive and when I ran the webpage from inside Dreamweaver. If I copy the files to another drive, the javascript does not work anymore if not inside D drive. It used to work before but  not. I got the data directly from the production server to make sure I was not making any major changes. The code in the production server works.  I have no idea why it is doing this. Can you guys offer any help? I've tried many things and nothing works. Thanks.

       

      Here is the html:

       

       

       

       

            

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml"  lang="en-US">

       

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

      <title>Texas Forestry Economic Impact</title>

      <style type="text/css">

       

       

      <script type="text/javascript">

      function updateSwfSize(myHeight, myWidth)

          {

          var flexibleGorillaSwf = swfobject.getObjectById("FlashID");

          flexibleGorillaSwf.height = myHeight;

          flexibleGorillaSwf.width = myWidth;

       

          }

       

       

      </script>

       

       

      <script type="text/javascript" src="swfobject.js">

       

      </script>

      <script type="text/javascript">

      swfobject.registerObject("FlashID", "10.0.0");

      </script>

       

      </head>

       

      <body id="body" >

       

       

      <div class="container">

       

      <table width="100%" border="0" cellpadding="0" cellspacing="0">

             <tr>

            <td bgcolor="#6f8d5c">

          <img src="assets/banner_maroon.png" width="960" height="120" usemap="#map-1" alt="Texas Forest Service " style="border:none;"/>

       

          <map name="map-1" id="imagemap">

          <area shape="rect" coords="26,5,139,115" href="About.html" alt="Link to Texas Forest Sector Economic Impact Home"/>    

          <area shape="rect" coords="142,3,582,27" href="About.html" alt="Link to Texas Forest Sector Economic Impact Home"/>

          <area shape="rect"  coords="159,27,324,46" href="EcoImpactTX.html" alt="Link to Texas Forest Sector Economic Impact Summary Tool" />

          <area shape="rect"  coords="755,47,1201,200" href= "http://txforestservice.tamu.edu/main/default.aspx" alt="Link to Texas Forest Service Website" />

           </map>

           </td>

        </tr>

            <tr>

          <td height="31" bgcolor="#6f8d5c"><a href="http://www.texasforestinfo.com">TexasForestInfo.com</a>  -  <a href="About.html"  >About</a>  -  <a href="Highlights.html">Highlights</a>  -  <a href="EcoImpactTX.html" target="_self"><span style="font-size:medium; font-weight:bold">Summary Tool</span></a>  -  <a href="Maps.html" target="_self">Maps</a>  -  <a href="Trends.html" target="_self">Trends</a>  -  <a href="Reports.html" target="_self">Download Reports</a>  -  <a href="FAQs.html" target="_self">FAQs</a>  -  <a href="ContactUs.html" target="_self"> Contact Us</a>  -  <a href="http://txforestservice.tamu.edu/main/default.aspx">TFS Home</a></td>

        </tr>

         <tr>

          <td height = "0" bgcolor="#FFFFFF"> </td>

        </tr>

      </table>

      <p><span style="font-size:x-large; color:#000">Summary Tool </span> <span style="font-style:italic">(click one of the buttons below to start)</span></p>

       

      <div class="swfcontainer">

        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="930" height="1000" id="FlashID" title="map" >

          <param name="movie" value="New_ecoimpact_april25th_newPDF.swf" />

          <param name="quality" value="high" />

          <param name="swfversion" value="6.0.65.0" />

          <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->

          <param name="expressinstall" value="Scripts/expressInstall.swf" />

          <param name="SCALE" value="exactfit" />

       

          <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->

          <!--[if !IE]>-->

          <object name="FlashID" data="New_ecoimpact_april25th_newPDF.swf" type="application/x-shockwave-flash" width="930" height="1000" pluginspage="http://www.adobe.com/go/getflashplayer" >

            <!--<![endif]-->

            <param name="quality" value="high" />

            <param name="swfversion" value="6.0.65.0" />

            <param name="expressinstall" value="Scripts/expressInstall.swf" />

            <param name="SCALE" value="exactfit" />

       

            <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->

            <div>

              <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>

              <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>

              </div>

            <!--[if !IE]>-->

            </object>

          <!--<![endif]-->

        </object>

       

      </div>

      <p><!-- end .content --></p>

      <div class="footer">

        <table width="100%" border="0" cellpadding="0" cellspacing="0">

        <tr>

             <td width="0" height="31" bgcolor="#6f8d5c" ><a href="http://www.texasforestinfo.com"><span style="color:#FFF">TexasForestInfo.com</span></a>  -  <a href="About.html" >About</a>  -  <a href="Highlights.html"><span style="color:#FFF">Highlights</span></a>  -  <a href="EcoImpactTX.html"  target="_self"><span  style="color:#FFF; font-size:medium; font-weight:bold;" >Summary Tool</span></a>  -  <a href="Maps.html" target="_self"><span  style="color:#FFF;">Maps</span></a>  -  <a href="Trends.html" target="_self"><span  style="color:#FFF; " >Trends</span></a>  -  <a href="Reports.html" target="_self"><span  style="color:#FFF; ">Download Reports</span></a>  -  <a href="FAQs.html" target="_self"><span  style="color:#FFF">FAQs</span></a>  -  <a href="ContactUs.html" target="_self"> <span  style="color:#FFF">Contact Us</span></a>  -  <a href="http://txforestservice.tamu.edu/main/default.aspx"><span  style="color:#FFF">TFS Home</span></a></td>

        </tr>

      </table>

      </div>

      <div class="footer2">

      <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">

        <td width="108" style="padding-top:5px; "  > </td>

              <td width="750" style="line-height: 16px; padding-top: 5px; text-align: center; color:#666; padding-left:12px; padding-bottom:5px">

                Copyright © 2012 Texas  Texas A&amp;M Forest Service. All rights reserved. <br />

                  <a href='http://tfsweb.tamu.edu/main/article.aspx?id=6698' target='_blank' style="color:#666; padding-left:12px; ">Accessibilty, Site Policies & Public Notices</a>

       

       

              </td>

              <td width="102" style="text-align: right; padding-right: 22px"> </td>

      </table>

      </div>

      </div>

       

       

       

      </body>

      </html>

        • 1. Re: Javascript does not work when I move files to another drive
          Jon Fritz II MVP

          I see a reference to "swfobject.js" did you also copy that file over and place it in the same directory as the page itself?

          • 3. Re: Javascript does not work when I move files to another drive
            Jon Fritz II MVP

            There's nothing in your code that is looking at the previous drive from what I can see. Everything appears to be document relative or absolute paths. If everything was copied over, and kept in an identical directory structure, there's no reason it shouldn't work.

             

            If you moved any files into or out of folders that aren't exact duplicates of what's on the original drive, it would break though.

            • 4. Re: Javascript does not work when I move files to another drive
              ionara17 Community Member

              I tried this: I opened the html in D drive in Dreamweaver and saved it in the d drive and then copy the other files to the same drive. When asking if I wanted to update links I said yes. When I opened the html in the P drive all the links point to the D drive and the javascript works, but just because it is referencing the files in the D drive. Why is this website stuck in the D drive even if I use an absolute path.

               

              Here is the example:

               

              If I copy the file from the D drive to the P drive and javascript does not work:

               

              script type="text/javascript" src="swfobject.js">

               

              If I save the file in the D drive to the P drive updating the links. The javascript works:

               

              <script type="text/javascript" src="file:///D|/ECONOMIC_IMPACT_APRIL2013/swfobject.js">

              • 5. Re: Javascript does not work when I move files to another drive
                ionara17 Community Member

                That's what I thought, but I am copying the whole folder to the other drive. No files are missing when I copy it, but it does not work. This is driving me nuts. I am pretty upset with Dreamweaver for doing this.

                • 6. Re: Javascript does not work when I move files to another drive
                  Jon Fritz II MVP

                  If it were me, I would copy the entire site folder from one drive onto the other. Then in DW, I would update the Site Definition to point to my newly copied folder on the new drive.

                   

                  If I were moving my site from one drive to a new drive and didn't plan on touching the old copy again.

                   

                  What is it that you're trying to do exactly?

                  • 7. Re: Javascript does not work when I move files to another drive
                    ionara17 Community Member

                    I am trying to move to another drive (a public drive) so the people in IR can put in the development server for me to  test it. It used to work this way without problems. I did what you suggested. I copied all the files from the D drive to another folder in the P drive. Then I created a new site and changed the Local Site Folder to the P drive folder. I think it asked me a question about cache, I think I clicked "yes" and it copied all the files but with links referencing the D drive like

                     

                     

                    <script type="text/javascript" src="file:///D|/ECONOMIC_IMPACT_APRIL2013/swfobject.js">

                     

                    And of course the code works. When  I tried a second time it did not ask me any questions, I just see a quick message saying something about a cache, and the files have relative paths like:

                     

                     

                    <script type="text/javascript" src="swfobject.js">

                     

                    but of course the javascrip does not work. Any ideas why? I have been trying to figure this out for 2 days already. I am very upset with Adobe for not having a number we can call and ask about these things. Frustrating!  Thank you for trying to help! I really appreciate it!

                    • 8. Re: Javascript does not work when I move files to another drive
                      Jon Fritz II MVP

                      This isn't making a lot of sense.

                       

                      Are your original D drive files showing that file://D... style link in their source?

                       

                      When you copied from D to P, did you use DW to make the copies, or did you use your OS?

                       

                      If you used DW, don't.

                       

                      Copy the files outside DW, then make a new site file and set the new folder on P as the "Where on this computer do you want to store your files".

                       

                      As long as your links in the original files are not absolute paths to the hard drive they're on (you want document relative links) there should be no issue.

                      • 9. Re: Javascript does not work when I move files to another drive
                        ionara17 Community Member

                        Jon,

                         

                        I tried something else: In the P drive, I changed the html to have relative paths for the script tags and link, images but the link to the swf file to come from the D drive and the javascript worked so the problem seems to be the path to the swf.

                         

                        This is the relative path for the javascript file

                         

                        <script type="text/javascript" src="swfobject.js">

                         

                        But the swf file have absolute paths to the D drive. I have no idea how to fix this. Any thoughts?

                         

                         

                         

                         

                         

                         

                        <div class="swfcontainer">

                           <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="930" height="1000" id="FlashID" title="map" >

                            <param name="movie" value="file:///D|/ECONOMIC_IMPACT_APRIL2013/New_ecoimpact_april25th_newPDF.swf" />

                            <param name="quality" value="high" />

                            <param name="swfversion" value="6.0.65.0" />

                            <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->

                            <param name="expressinstall" value="file:///D|/ECONOMIC_IMPACT_APRIL2013/Scripts/expressInstall.swf" />

                            <param name="SCALE" value="exactfit" />

                         

                            <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->

                            <!--[if !IE]>-->

                            <object name="FlashID" data="file:///D|/ECONOMIC_IMPACT_APRIL2013/New_ecoimpact_april25th_newPDF.swf" type="application/x-shockwave-flash" width="930" height="1000" pluginspage="http://www.adobe.com/go/getflashplayer" >

                              <!--<![endif]-->

                              <param name="quality" value="high" />

                              <param name="swfversion" value="6.0.65.0" />

                              <param name="expressinstall" value="file:///D|/ECONOMIC_IMPACT_APRIL2013/Scripts/expressInstall.swf" />

                              <param name="SCALE" value="exactfit" />

                         

                              <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->

                              <div>

                                <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>

                                <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>

                                </div>

                              <!--[if !IE]>-->

                              </object>

                            <!--<![endif]-->

                          </object>

                         

                        </div>

                        • 10. Re: Javascript does not work when I move files to another drive
                          ionara17 Community Member

                          No, all links have relative paths. Where do I find "Where on this computer do you want to store your files".? When I click to add a site I don't have that option. There are a bunch of tabs and the first one is called Site, and it has an option to write a site name and the local site folder. I am using Dreamweaver CS5

                          • 11. Re: Javascript does not work when I move files to another drive
                            Jon Fritz II MVP

                            In DW go to Site > New Site

                             

                            The first screen should ask for the site name and the Local Site Folder. Enter whatever name you like and browse to the newly copied folder. Pay very close attention to where you browse here. Make sure you browse to the folder on the correct drive. This could be why it wasn't working, you may have inadvertantly had the path set to the D drive instead of the P drive.

                             

                            If the drive path is set to P, and there are no file://D... style links in the copied pages, there is literally no way DW could possibly add in the file://D... to your links.

                            • 12. Re: Javascript does not work when I move files to another drive
                              Nancy O. MVP

                              Site > New Site > Advanced.   See screenshot:

                              DW-CS6-LocalSiteFolderDef.jpg

                               

                               

                              Nancy O.

                              • 13. Re: Javascript does not work when I move files to another drive
                                ionara17 Community Member

                                I have that, but it is not under Advanced, right? It is under the tab "site". I have created sites a million times to try to fix this so I am pretty sure I entered the new folder name. I wish it was that. dreamweaver.png

                                • 14. Re: Javascript does not work when I move files to another drive
                                  Jon Fritz II MVP

                                  OK. Let's start from scratch.

                                   

                                  1. From outsite DW, copy the site folder (named?) to the new drive

                                   

                                  2. Then from DW, go to Site > New Site

                                   

                                  3. Add a Site Name

                                   

                                  4. Click the folder icon to the right of the Local Site Folder text area and browse to the newly copied folder from step 1 (make sure the path is to the P drive version, not the D drive version)

                                   

                                  5. Click Save. You can add FTP and everything else later (with Site > Manage Sites), we just want to get the site where it belongs without accidentally getting the D drive involved.

                                  • 15. Re: Javascript does not work when I move files to another drive
                                    ionara17 Community Member

                                    I've just tried again because you asked me. It does not work,unfortunatelly.

                                    • 16. Re: Javascript does not work when I move files to another drive
                                      Jon Fritz II MVP

                                      I'm completely stumped.

                                       

                                      That just doesn't make any sense.

                                       

                                      If all of the site's files are in one folder and that folder is copied to a new drive from the OS, I have no idea how a new site in DW could possibly know to add in the file://D: to the links.

                                       

                                      Maybe try clearing the DW Cache file first, then go through the copy/new site process again...

                                       

                                      http://forums.adobe.com/thread/494811

                                       

                                      After that, I'm completely out of ideas.

                                      • 17. Re: Javascript does not work when I move files to another drive
                                        Nancy O. MVP

                                        It's not uncommon for SWF files to contain absolute paths to supporting files.  This probably occurred when the Flash project was created.  If you can't open the SWF files and edit those paths manually, you may need to re-create the Flash project on your new drive.

                                         

                                         

                                        Nancy O.

                                        • 18. Re: Javascript does not work when I move files to another drive
                                          ionara17 Community Member

                                          I don't have links to absolute paths in my flash code. The function inside the code is calling the function inside the html, but just calling it by the name.

                                          To test it, I exported a fresh release build, copied all the files to the P, D, C, External and S drives. The scripts worked on the D and S drives, but not the other ones, which tells me there is something about the drives that DW does not like, but I have no idea what it is as if it works in the D drive, why not in the C drive? Both are local.

                                           

                                          Jon, I cleared the cache and even the configuration folder, nothing changes. Even if it does not add the links (that just happened once) it does not understand the relative paths in the file. I am frustrated to think that it works for the D and S drives but not the rest. Something is very wrong but I have no idea why it would do that. Why would the javascript work in two drives but not in the other drives when all the files were copied and there are relative paths? It is funny that it works for the all links but not for the object tags where the swf is imbedded.

                                          • 19. Re: Javascript does not work when I move files to another drive
                                            Jon Fritz II MVP

                                            When you copy the files to P from D, can you open them in a browser (don't use DW at all)?

                                             

                                            Open a browser then choose File > Open and browse to one of the newly copied files on D:.

                                             

                                            Let's take DW out of the equasion and see if there's an HD/OS/Drive issue.

                                            • 20. Re: Javascript does not work when I move files to another drive
                                              ionara17 Community Member

                                              Yes, I can open all the files in a browser. However the javascript code just work on the files that worked in Dreaweaver. So when I open a file in the browser and this file is in the D drive, the javascript works, but if the file is in the P drive, it does not work. The P drive is a public drive, the C drive is local, the D drive is local and the S drive is shared, which means that it works ina a shared drive (S) and in a local drive (D), so it does not make any sense.

                                              • 21. Re: Javascript does not work when I move files to another drive
                                                Nancy O. MVP

                                                Sounds like your P drive is read only.

                                                 

                                                 

                                                Nancy O. 

                                                • 22. Re: Javascript does not work when I move files to another drive
                                                  ionara17 Community Member

                                                  But how about my local C drive? Why would not work there?

                                                  • 23. Re: Javascript does not work when I move files to another drive
                                                    Jon Fritz II MVP

                                                    Weird, so you have 4 identical copies of your site and it only works on two of your four drives?

                                                     

                                                    I wonder if this could this be a user account/permissions issue?

                                                     

                                                    Can you create a new admin level user account on that machine and try the copy/open thing again (don't use the files already copied)?

                                                     

                                                    I might be way off base, but I've honestly never seen anything like this before, especially if it's working on D: and S: but not your C: and P: drives.

                                                    • 24. Re: Javascript does not work when I move files to another drive
                                                      ionara17 Community Member

                                                      Ok, I will try that Jon, I've never seen this either. Also, can you take a look at these images I am attaching. This is a list of broken links. This is in the S drive, which works fine, but for some reason there is a folder in the  bin-release  called srcview with some links missing.Can you check the links and let me know if this maybe the cause of all this? Thanksdreamweaver21.pngdreamweaver22.png

                                                      • 25. Re: Javascript does not work when I move files to another drive
                                                        ionara17 Community Member

                                                        Jon, I tried but apparently I can't create user accounts in Control Panel. The option of adding users is not there. Maybe IR does not allow that, I am not sure. Thanks

                                                        • 26. Re: Javascript does not work when I move files to another drive
                                                          ionara17 Community Member

                                                          Jon and Nancy,

                                                           

                                                          Now I am also having issues with the D drive, the only left is the S drive. I noticed that when made a change in the DW, I got a sharing violation message so I believe there is something to do with Dreamweaver and a sharing violation but it is affecting all drives when I make a change and try to save it in DW. I get the following message and a TMP file is created.

                                                           

                                                          Encountered a sharing violation while accessing

                                                           

                                                           

                                                          I tried to do what others mentioned in this post and deleted any files that ended with tmp in the D drive but the problem persists.  Any ideas on what I can do for this to stop? Any caches I need to clean, anything that needs to be changed in DW? Thanks

                                                           

                                                          http://forums.adobe.com/thread/516701

                                                          • 27. Re: Javascript does not work when I move files to another drive
                                                            Nancy O. MVP

                                                            You're not  using file check-in / check-out or subversion are you?

                                                             

                                                             

                                                            Nancy O.

                                                            • 28. Re: Javascript does not work when I move files to another drive
                                                              ionara17 Community Member

                                                              Hi Nancy, Not sure what that is, but If you are asking me if I am using tthe server, not. Everything is local.

                                                              • 29. Re: Javascript does not work when I move files to another drive
                                                                ionara17 Community Member

                                                                Thank you Nancy and Jon for your help. After trying everything imaginable since Friday things came back to normal in the P drive. However the problem continues for the C and D drives but I figured it might be something with that webpage being originally created as a template (another developer created that page before me) and so the webpage in other drives  kept referring to it as it is described in this article:

                                                                 

                                                                http://helpx.adobe.com/dreamweaver/kb/paths-dreamweaver-templates.html

                                                                 

                                                                 

                                                                What I did to circunvent that was to add the folder as a trusted site in the Security Manager (I am not sure why this worked), deleted the cache as described in the forum below and recreated the files in Aptana and then copy them to the P drive.

                                                                 

                                                                http://forums.adobe.com/thread/827582?tstart=0

                                                                 

                                                                What it is interesting is that when I deleted the original folder in the D drive, all the links in the webpage in the development server disappeared, giving me the final clue this was an issue with paths and nothing on the code. I believe this was an isolated problem with just this webpage, so hopefully this will not happen anymore. I hope I can help anyone with a similar problem by posting the partial solution here.