Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it Ok to use '../' in relative paths?
    primarykey
    data
    text
    <p>I am using extjs4 to build a webapp that resides within drupal.<br> Many of my ajax calls are to menu items in a module within drupal.<br> The images my css directs to sometimes reside within my extjs folder, and sometimes in drupal.</p> <p>A coworker insists that relative paths that use '../dir_a/' are bad design, and are prone to risks.</p> <p>Is this correct? Is there another way?</p> <p>My folder structure:</p> <pre><code>- drupal - v2 (extjs home folder) - css - extjs - sites - mySite - modules - webApp </code></pre> <p>My css files contain calls like these:</p> <pre><code>.x-action-col-cell img.restart-test-icon { background-image: url(../extjs/examples/sandbox/images/gears.png); } </code></pre> <p>My applications has calls like these:</p> <pre><code>Ext.Ajax.request({ url: '../webapp/tests/create/', method: 'Post' }); </code></pre> <p><strong>Edit:</strong> Commenters have asked for clarification. The coworker's two main issue with this are:<br> 1. "If the server side code will generate an address like <code>/a/b/c</code> without a trailing <code>/</code> you might have a situation where you get <code>/a/b/c../d</code>"<br> <em>True? This sounds more like a server side problem.</em><br> 2. "Have you seen anyone else using it?"<br> <em>Which in my opinion is a very poor way to decide anything.</em><br> But I went ahead and tested some JS intensive sites (gmail, aws), using firebug and found no use of <code>../</code> in their JS or CSS.<br> Can anyone help me back up my claim that it's perfectly OK?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload