src absolute path problem
You should be referencing it as localhost. Like this: <img src=”http:\\localhost\site\img\mypicture.jpg”/>
You should be referencing it as localhost. Like this: <img src=”http:\\localhost\site\img\mypicture.jpg”/>
All views can take a background image. The src to an ImageView has additional features: different scaling types adjustViewBounds for setting bounds to match image dimensions some transformations such as alpha-setting And more that you may find in the docs.
../images/logo.png will move you back one folder. ../../images/logo.png will move you back two folders. /images/logo.png will take you back to the root folder no matter where you are/.
A leading slash tells the browser to start at the root directory. If you don’t have the leading slash, you’re referencing from the current directory. If you add two dots before the leading slash, it means you’re referencing the parent of the current directory. Take the following folder structure notice: the ROOT checkmark is green, … Read more
Use a HTML parser like DOMDocument and then evaluate the value you’re looking for with DOMXpath: $html=”<img id=”12″ border=”0″ src=”https://stackoverflow.com/images/image.jpg” alt=”Image” width=”100″ height=”100″ />”; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); $src = $xpath->evaluate(“string(//img/@src)”); # “https://stackoverflow.com/images/image.jpg” Or for those who really need to save space: $xpath = new DOMXPath(@DOMDocument::loadHTML($html)); $src = $xpath->evaluate(“string(//img/@src)”); And … Read more
Put this in the js file that needs to know it’s own url. Fully Qualified (eg http://www.example.com/js/main.js): var scriptSource = (function(scripts) { var scripts = document.getElementsByTagName(‘script’), script = scripts[scripts.length – 1]; if (script.getAttribute.length !== undefined) { return script.src } return script.getAttribute(‘src’, -1) }()); Or As it appears in source (eg /js/main.js): var scriptSource = (function() … Read more
You should be setting the src using this: document[“pic1”].src = searchPic.src; or $(“#pic1”).attr(“src”, searchPic.src);
<script> var config=true; </script> <script src=”https://stackoverflow.com/questions/1017424/myscript.js”></script> You can’t pass variables to JS the way you tried. SCRIPT tag does not create a Window object (which has a query string), and it is not server side code.
In this case, it’s probably because you are using the wrong brackets here: document.getElementById[‘calendar’].src = loc; should be document.getElementById(‘calendar’).src = loc;
It would be a security vulnerability if the client could request local file system files and then use JavaScript to figure out what’s in them. The only way around this is to build an extension in a browser. Firefox extensions and IE extensions can access local resources. Chrome is much more restrictive.