Paths in Javascript


Hello
I have problems with the directory paths in my models. When I create a file of my template, it update all the paths, but not those of my Javascript code. What I am doing wrong?

Thank you
Silver

As the same as the
> those who generate the Imageready.

If it is a function of imageready, dw sees it as a third-party custom js
work and don't update the paths.

If you remade with functions of dreamweaver image swapping, it would update
the paths.

>
> I'm really new with this kind of thing can you be more specific
> "the solution is to use relative paths from the root of the site, or the absolute paths.

I'm guessing you used relative paths of document.
Change paths so that they are relative or absolute site root.

fake code:
my_function('.. / images/blah1.jpg','1','2')

It is a relative path document saying to go up one folder level, then in
the pictures folder.

If you want the image is actually here:
http://www.example.com/images/blah1.jpg
then use one of these paths

my_function('/images/blah1.jpg','1','2')

It is relative to the site root, it starts from the root of the domain name.

ma_fonction (' http://www.example.com/images/blah1.jpg ', '1',' 2')

It is an absolute path

or the other of these paths will work because they do not need to be managed or
adjusted to the location of the file in which the code is located. The path is the same
of any page of any level of folder in the site.

--
Alan
Adobe Community Expert, dreamweaver

http://www.Adobe.com/communities/experts/

Tags: Dreamweaver

Similar Questions

  • Dreamweaver follow certain paths of JavaScript

    I have a site with a few animations using JavaScript.

    I guess I could put an absolute path (http:/mysite/images/folder/myimage.png) but I wonder if there is a way to show the way so that I can have a model handle the path no matter where the web page is on my site. I use directories to organize things.

    At issue is the 62 line in my template:

    http://bouncezonect.com/templates/bouncezone.dwt

    Configure the paths of the images, most of the target links

    slideshowimages ("images/bouncer/bounce-zone001.png","images/bouncer/bounce-zone002.png", "i mages/bouncer/bounce-zone003.png","images/bouncer/bounce-zone004.png","images/bouncer/boun ce-zone005.png","images/bouncer/bounce-zone006.png","images/bouncer/bounce-zone007.png","i mages/bouncer/bounce-zone008.png","images/bouncer/bounce-zone009.png","images/bouncer/boun ce-zone010.png","images/bouncer/bounce-zone011.png","images/bouncer/bounce-zone012.png","i mages/bouncer/bounce-zone013.png","images/bouncer/bounce-zone014.png","images/bouncer/boun the - zone015.png")

    The model shows the animation when I check it.

    Can Dreamweaver CS5.5 keep track of them? Is there a better way to write the JavaScript code so that Dreamweaver knows what to do? or I'm stuck doing absolute paths?

    http://bouncezonect.com/templates/bouncezone.dwt

    Configure the paths of the images, most of the target links

    slideshowimages ("/ images/bouncer/bounce-zone001.png", "/ images/bouncer/bo unce-zone002.png","/images/bouncer/bounce-zone003.png","/images/bouncer/ bounce - zone004.png",...)

    DW can't handle these links when they are integrated in JavaScript. Your solution is simple - make them relative root. While they must be managed anywhere in the site, the page of the child is located.

  • Paths of DW templates

    Hello

    I want to put javascript in my dreamweaver template to preload the images, using this script:

    < script type = "text/javascript" >
    pic1 = new image (100,25);
    pic1. "SRC ="... / img/navbarh.gif ";
    < /script >

    With most of the things in patterns, such as images, when the model creates a page, it rewrites the path of the image so that the page created from the model to the correct points up. That is to say. in the model, the path will be /img/navbarh.gif instead of... img /.

    The problem is that when I inside javascript with the code above, it is not rewrite the path. Is there a way to get there?

    Thank you.

    No, Dreamweaver will not rewrite the path in JavaScript.

    Why not use a relative to the root site link?

    
    
  • Publication of Animate sometimes adds a string of numbers after .js.

    I've been running into a one question on since I started to animate. After I publish a file, I go into the HTML file and you notice a string of the instance numbers one '? ' after the path to javascript.

    Any idea what could cause this problem?

    I am currently using build #15.1.0.201. I have a few built custom templates that I use to include meta data tags in the advertising banners that I created that I use...

    Any help would be greatly appreciated. It is seriously slowing my workflow every time I need to check a file after its publication.

    Thank you!

    Screenshot 2016-02-18 10.26.40.png

    Hello

    You'll see a random query params dummy attached to assets during test movie. This is done to avoid caching aggressive done by browsers which will also not updated your release of test. You will not see the query parameters if you publish the file(File>Publish).

    I hope this helps.

    Thank you!
    Mohan

  • Adding a PDF button to help answer?

    The new reactive provision contains a button "print" for all subjects; However, I would also add a PDF button that shows the section of a PDF file.  I thought I might have to follow the path of JavaScript to get this.  Anyone know an easier way or have a code that they would like to share or point me towards?

    Thank you

    Jason

    There are some JavaScript libraries that allow to generate PDF documents, but I have not tried any of them. For example: jsPDF - create a PDF with JavaScript HTML5 library

    Your mileage may vary. But if you want to create a PDF file, why not build one with RoboHelp and add that, as a download for your help?

  • Can someone help me and explain how to assign hotspot/image map with rules of css or any other way?

    I have problem with hotspot because its position cannot be fixed to follow the proportion of the fixed background in different resoulutions.

    You cannot assign hotspots with css. Here are some options different however, you have...

    You can try to use several images that can evolve, linking each image, instead of hot spots.

    You can also look into "sensitive image maps" to get examples of jquery/javascript run interactive images that can be resized.

    According to your image (for example, if you are linking States on a map) you would be able to use the SVG paths and link paths with javascript.

  • Different behavior on Mac/Win

    Hello

    I am currently working on an Extension of the Creative Suite, which will show a collection of images on a Panel (InDesign, Photoshop and Illustrator).

    I need path of the application in a few javascript files and I'm getting weird problems on our Mac tests. I reduced the code in as few lines as possible, to show the problem.

    Currently I use Photoshop CS5.1, Flash Builder 4.6 and Extension Builder 1.5 on my windows machine.

    This is the code:

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "

    Initialize = "initializeHandler ()" >

    < mx:Script >

    <! [CDATA]

    import com.adobe.csawlib.photoshop.Photoshop;

    com.adobe.photoshop import. *;

    protected function initializeHandler (): void

    {

    var app: com.adobe.photoshop.Application = com.adobe.csawlib.photoshop.Photoshop.app;

    If (App.Path)

    MyLabel.set_Text = app.path.nativePath;

    on the other

    MyLabel.set_Text = "app.path was null;"

    }

    []] >

    < / mx:Script >

    < mx:VBox height = "100%" width = "100%" verticalAlign = "middle" horizontalAlign = "center" >

    < mx:Label id = "myLabel" / >

    < / mx:VBox >

    < / mx:Application >

    On my Windows machine myLabel shows the path of the installation directory. On our Mac app.path is zero, so it does not work.

    I tried different approaches to solve this problem, but it does not work yet. Here are some ideas of what I've tried so far:

    -Get the path in Javascript instead of using app.path.fsName (app.path is null on Mac in Javascript too, at least when it is called by the initialzeHandler)

    -Put a timer in the initializeHandler, wait 10 seconds and try to get the path then (not a good idea and app.path is always set to null)

    -Place a button on the Panel that runs the initializeHandler instead. (app.path works, but I need this to work without user intervention).

    Can someone enlighten me please?

    BTW. I'm a developer intern, so it is likely that there is a simple solution or an obvious mistake, do not hesitate to report them.

    These discussions could help:

    http://forums.Adobe.com/message/2983515#2983515

    http://forums.Adobe.com/message/3041081#3041081

    And read this cookbook entry:

    http://cookbooks.Adobe.com/post_Creative_Suite_Extensions_and_the_Photoshop_CS5_Re-17727.h tml

    Substances

  • Option button to open the form

    Hi all. I'm looking for some tips and operating instructions.

    I have created several forms of LC. When the user clicks on a particular radio button in Form1, let me to open Form2. Also, I would be willing to transfer the contents of Form2 in the formula 1 and only 'jump' to this article.

    I don't have a lot of knowledge coding, so I tried to use FormCalc (instead of JavaScript) to run the command Get, but it keeps returning the error "error trying to read file...". ». Then I abandoned this path to try the seemingly simpler course Flowed subforms. However, it seems not that I can change the layout of the objects. I spent about two months in the creation of these forms and databases associated with a specific provision.

    Or the other of them are a viable option for my problem? If so, how effectively to use scripts or how to manipulate the layout?

    Thanks in advance!

    Catherine

    Hello

    Using this way you need to make a path to JavaScript

    Source language

    K:\Catherine\Ex_Forms\Supplement_1_AffectiveDisorders_07_06_11.ex.PDF

    Becomes

    /K/Catherine/Ex_Forms/Supplement_1_AffectiveDisorders_07_06_11.ex.PDF

    My Code looked like this (I am not a K drive to test)

    app.openDoc ({cPath: "/ c/Catherine/Ex_Forms/Supplement_1_AffectiveDisorders_07_06_11.Ex.pdf"});

    and this opens the document as expected.

    Hope this helps

    Malcolm

  • Based on Photoshop CS2 to its limits with ActionScript

    I use Photoshop CS2 with Windows XP (latest SP) and a processor Intel Core 2 4 Gb RAM PC.

    Here's what I did:

    I developed a javascript for photoshop file that opens another file (big enough) and bed line by line and executes the line-by-line.

    It helped me to run something huge javascript.

    This kind of things of javascript... generates one of the largest (if not the largest) maze in the world.

    But.

    Photoshop 'agrees' to create a large file.

    Photoshop 'agrees' to shoot for a large number of times.

    Every 20 draws, Photoshop 'agrees' to empy the history (I think that would help to free RAM or other).

    After say 80% of the substance made, there is an error that appears.

    This isn't a problem with javascript, I swear to you that I was looking for this for months.

    My generated javascript file is correct.

    You can download things together here, unzip the in Photoshop scripts folder (usually "C:\Program Files\Adobe\Adobe Photoshop CS2\Paramètres prédéfinis\Scripts") and run (via "file = > script = > m")

    What I don't understand is:

    -Si Photoshop 'agrees' to create a large file.

    -Si Photoshop 'agrees' to shoot for a large number of times.

    -If each 20 tire, Photoshop 'agrees' to empy the history (I think this may help get RAM)

    Why hell it stops at a problem that seems to have nothing to do with memory allocation (but he doesn't actually : I generated more 1500 Scripts, then whenever I made the script more great and launched it: it worked without any problem at all so it's not a problem of my script (I generated a BMP file (with my own C program) that javascript file and it generated the maze correctly)).

    I'm fairly convinced that there is a problem with Photoshop and Photoshop only.

    Another problem, I had to face that is documented anywhere, even in the JavaScript help file, (I told you I pushed Photoshop to its limits ) is that you are limited to 999 points when you create a path in JavaScript. Why is this? This is not normal. So I had to change my Javascript program everything to make it work properly. Must create paths with 999 pixels, then draw, clear the path and son on.

    Please tell me if my script works either with CS4 and/or Windows Vista.

    My goal is to create something like 15000 15000 files pixels x (I'm not kidding).

    I was counting on Photoshop to use its own swap file and help me to generate mazes of greater than those that my C program generates. But it is impossible for the moment.

    Any help is greatly appreciated.

    So in species, I should have to:

    (1) launch 'M1', which creates the image, then runs 998000 lines

    (2) to save the image

    (3) quit photoshop

    (4) restart photoshop

    (5) re - load previously saved image

    (6) the "M2" launch, which creates the image, then runs it 998000 lines

    ..????

    I'll try that tonight.

    It should work.

    It is far easier and more pleasant. I hate it when we need hacks to make simple things work

    That's why I put in place a framework for dealing with this problem for me. I change my scripts to adapt the framework and leave the frame to take care of all the logic start/restart/stop.

    But if you need only to run the script from time to time, do it manually may be the simplest solution.

  • IK een javascript om vanuit photoshop illustrator paths search you i.e.

    IK een javascript om vanuit photoshop illustrator paths search you i.e.

    Hi Pragmeta,

    You will find an option to export paths from Photoshop to Illustrator.

    Go to file > export > traces to Illustrator.

    Please let us know if you are looking for another option.

    Concerning

    Sarika

  • What is the path of file system for javascript files?

    We want to keep our javascripts under version control using SVN.  SVN has features to do this, but they are all accessible from the file system location where the files are stored.  So where is it?  When the external editor is used, the file is copied to the Temp directory under the logged in user, but as soon as you close the editor, the file is deleted, so this isn't really an appropriate place for SVN connection.

    Thank you!

    You can get this path as well using the same method, by replacing "javascript".

    with "sequences".

  • How JavaScript handles spaces in a directory path to save under instruction?

    Greetings,

    Below is a function I wrote that is supposed to save a file in jpeg format in a specific subfolder on my machine. The directory path has several areas and it is originally the function fails. (There is a space in Partnership DCS and TAC project on line 2 of the function below).

    Does anyone know how to write a path in the object of the new file that has spaces in the path? (It is perhaps a special character to denote a single space?)

    function saveScene (fileName) {}

    jpgFile = new File ("project of partnership/TAC C / Temp / DCS / Scenes_Listellos" + filename);

    jpgSaveOptions = new JPEGSaveOptions();

    jpgSaveOptions.embedColorProfile = true;

    jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;

    jpgSaveOptions.matte = MatteType.NONE,

    jpgSaveOptions.quality = 12;

    docActive.saveAs (jpgFile, jpgSaveOptions, true, Extension.LOWERCASE);

    } / / end of function saveScene

    Try:

    jpgFile = new file ("/ Project C/Temp/DCS partnership/TAC/Scenes_Listellos" + filename);

  • JavaScript get the current path without %20 and / backslash

    Hello

    If I try to get my way .indd, is to give the path with %20 and / backslash and ":" lack also.

    How can I get my way with the exact format because I need to pass the path as an argument to a file beats.

    Please let me know if any idea you have.

    Use the following code:

    Folder.Decode (folderPath); where folderPath is the location of the file.

  • Path missing iTunes Songs (already tried script)

    Hello

    recently I moved all of my itunes library to my new computer (Mac-> Windows), I noticed that some songs bad location path, and I discovered that the songs with special characters (like aeioun, Yes, I'm Spanish) are those who have suffered from this problem.

    ITunes can't find the songs automatically, said that almost the 2000 song are not and nothing else.

    I'm used to manage xml and looked up in the itunes library xml file and to know that these songs with special characters did not alter his path to the new properly, they keep the way old-macintosh, something like "http://localhost \volumes\macintosh\music\blablabla\".

    The thing is, I tried out solved with samsoft script, but the suggested path does not match my only current. I saw this script search paths similar to what itunes automatically creates, but in my case, I made my own path model (something like \music\%artist%\%artist%-%year%-%album%\%artist% - track - %title%).

    In my xml library I set paths, but when I tried to rebuild the itl file, missing tons of songs and I got crazy once more.

    Is it possible to code in hard itl file to replace this wrong paths? It's just replace 'file://localhost/volumes/macintosh/Music' ' file://localhost/D: / Music»

    I think about modifying the script samsoft to correspond with my custom path, but I am a junior Javascript coder, and I have no idea how this VBS script works.

    Thank you!

    Turingtet2 article may help:

    Empty/corrupted library iTunes after upgrade/crash

  • I get a JavaScript Application error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    I get a pop up box with the message: Application JavaScript error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    But it seems to appear when I go to Amazon.com. Then he opens with this message and the OK option? But as fast as I can click OK, another box appears. After all a half dozen, she disappears - until what I move to another part of Amazon! I uninstalled - reinstalled and then - Firefox and BA. I do not understand this!

    (And of course, there is always the possibility that it is not only attacking me on Amazon... There may be a lot of other sites that also trigger, and I just haven't been there yet.)

    Hello

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • In Firefox 29,0 and above, click on the menu button

      click Help

      then select restart with disabled modules.

    • In previous versions of Firefox, click on the Firefox button in the upper left of the Firefox window and click help (or click on help in the Menu bar, if you do not have a Firefox button) and click on restart with disabled modules.

    If Firefox is not running, you can start Firefox in Mode safe mode as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

Maybe you are looking for