File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <entry type =" method" name =" jQuery.mobile.path.makePathAbsolute" return =" Boolean" >
3+ <title >jQuery.mobile.path.makePathAbsolute()</title >
4+ <desc >Utility method for converting a relative file or directory path into an absolute path.</desc >
5+ <signature >
6+ <argument name =" relPath" >
7+ <type name =" String" >
8+ <desc >A relative file or directory path.</desc >
9+ </type >
10+ </argument >
11+ <argument name =" absPath" >
12+ <type name =" String" >
13+ <desc >An absolute file or directory path against which to resolve.</desc >
14+ </type >
15+ </argument >
16+ </signature >
17+ <example >
18+ <desc >Various uses of jQuery.mobile.path.makePathAbsolute</desc >
19+ <css ><![CDATA[
20+ #myResult{
21+ border: 1px solid;
22+ border-color: #108040;
23+ padding: 10px;
24+ }
25+ ]]> </css >
26+ <html ><![CDATA[
27+ <div role="main" class="ui-content">
28+ <input type="button" value="file.html relative to /a/b/c/bar.html" class="myButton" data-inline="true">
29+ <input type="button" value="../../file.html relative to /a/b/c/bar.html" class="myButton" data-inline="true">
30+ <div id="myResult">The result will be displayed here</div>
31+ </div>]]> </html >
32+ <code ><![CDATA[
33+ $(document).ready(function() {
34+
35+ $( ".myButton" ).on( "click", function() {
36+
37+ var arguments = $( this ).attr( "value" ).split( " relative to " ),
38+ absolutePath = $.mobile.path.makePathAbsolute( arguments[ 0 ], arguments[ 1 ] );
39+
40+ $( "#myResult" ).text( absolutePath );
41+ })
42+ });
43+ ]]> </code >
44+ </example >
45+ <longdesc >
46+ <p >Given a path that is relative to another absolute path, this utility will convert the relative path to an absolute path based on the given absolute path.</p >
47+ </longdesc >
48+ <category slug =" methods/path" />
49+ </entry >
You can’t perform that action at this time.
0 commit comments