relative-path

Why is Magento 1.4 including javascript files by filesystem path?

六眼飞鱼酱① 提交于 2019-12-18 11:59:09
问题 I am in the process of testing a Magento 1.3 site using Magento 1.4. I am seeing very weird and inconsistent behavior. Instead of including the URL of my javascript files, Magento is creating tags with the full filesystem path of the js files, as so: <script type="text/javascript" src="/home/my_username/public_html/js/prototype/prototype.js"></script> I believe this is related to the new "Themes JavaScript and CSS files combined to one file" function. In fact, when I log into the admin and

Rails redirect with https

时间秒杀一切 提交于 2019-12-18 10:35:13
问题 I'm maintaining a Ruby on Rails site and I'm confused as to how to perform redirects to relative URLs using the https protocol. I can successfully create a redirect to a relative URL using http, for example: redirect_to "/some_directory/" But I cannot discern how to create a redirect to a URL using the https protocol. I have only been able to do so by using absolute URLS, for example: redirect_to "https://mysite.com/some_directory/" I would like to keep my code clean, and using relative URLs

java relative path

跟風遠走 提交于 2019-12-18 09:23:56
问题 Using the snippet below throws me a null pointer exception, but i can't find the reason: String path = ResourcesLoader.class.getResource("src/i3d/resourcesloader/libraries/lib.txt").toString(); Am i using the getResources wrong? I even tried to enter the full path, like "D:\Workspace...", double backslashes, double forwardslashes but i get the exception of null pointer. The only thing i haven't tried is using java's path separator, but that shouldn't be a problem at this moment as it runs on

Using a Relative Path in Javascript to Set Google Map Icon

ぐ巨炮叔叔 提交于 2019-12-18 08:40:06
问题 I've set the icon image in my Google map using an absolute url as follows: icon: 'http://mysite/wp-content/plugins/my_plugin/images/icon1.png' I set the image in this script: http://mysite/wp-content/plugins/my_plugin/js/myscript.js Is it possible to use a relative URL? Would the path from the js script be: ../images/icon1.png I've tried every way that I can think of. The Google map is in a WordPress plugin. WordPress has a lot of PHP functions for determining file paths. I could save file

Relative Path, but for Port?

别说谁变了你拦得住时间么 提交于 2019-12-18 07:28:07
问题 We are all familiar with relative paths: A relative path to ./images/hello.jpg from http://www.domain.com/hey links to http://www.domain.com/hey/images/hello.jpg . Problem: How do you state a relative path to http://www.domain.com:1234 when you are at http://www.domain.com/hey ? 回答1: This can be achieved using JavaScript by setting the window.location.port property. <a href="#" onclick="javascript:window.location.port=8080">go</a> 回答2: You cannot change any part of the authority (i.e. the

How to find relative path given two absolute paths?

放肆的年华 提交于 2019-12-18 06:12:14
问题 Given two absolute paths, e.g. /a/path/to/a /a/path/to/somewhere/else How can I get a relative path from one to the other, ../a ? In a sense, the opposite of what realpath does. 回答1: I answered a similar question here: Resolving a relative path without referencing the current directory on Windows. There is no standard function for this. There is a function in vi-like-emacs for this purpose. A quick check of apropos relative shows me few other programs which likely implement this: revpath for

PHP - Relative paths “require”

送分小仙女□ 提交于 2019-12-18 04:49:04
问题 My directory structure looks like this: blog -> admin -> index.php blog.php db.php functions.php I have been trying to include ( require , really) blog.php in the admin/index.php , but facing lots of errors. I'm following a PHP course, and the instructor does the same thing successfully. admin/index.php: require "../blog.php"; which, in turn, requires two more files in its directory. require "db.php"; require "functions.php"; 回答1: If you find that relative include paths aren't working as

building relative URLs for an MVC app with JavaScript

只愿长相守 提交于 2019-12-18 04:42:21
问题 I'm having trouble getting C# and JavaScript/jQuery to play nice here. I have a knockout view model, plain old javascript object... one of its property/methods fires off an .ajax() call, and the url parameter is built using some of its other property values (javascript variables). This works fine when completely contained in JavaScript, but when deployed as an app to IIS, the relative pathing is hosed. In MVC3 normally I would use something like @Url.Action and let the server side build the

Visual Studio: Relative Assembly References Paths

旧巷老猫 提交于 2019-12-17 22:29:18
问题 When adding a reference to an assembly located within the solution directory, is there any way to add it relatively, so that when checked in and out of a repository it is referenced in projects correctly? 回答1: To expand upon Pavel Minaev's original comment - The GUI for Visual Studio supports relative references with the assumption that your .sln is the root of the relative reference. So if you have a solution C:\myProj\myProj.sln , any references you add in subfolders of C:\myProj\ are

Codeigniter - dynamically getting relative/absolute path outside of application folder

北城以北 提交于 2019-12-17 21:57:46
问题 I am attempting to have a temporary cache folder of sorts just outside of and at the same level as the application folder. This is for storing images for a couple moments before moving them off-site. I am trying to get a user's Facebook profile image and save it to my server. I have an image storage solution which requires me to take the photo, and rename it then pass it to the respective location for storage. My thoughts were using file_get_contents() and file_put_contents() I could store