call .htc file from all html pages withot adding url domain - html-components

In that same CSS rule, add the following style line:
behavior: url(path/to/PIE.htc);
Of course you will need to adjust the path to match where you uploaded PIE.htc in step 2. Note: this path is relative to the HTML file being viewed, not the CSS file it is called from.
but if my url is domain.com/foo/foo.html PIE.htc is not loaded any more if i use
behavior: url(PIE.htc);
PIE.htc is located in root. Can i somehow always call .htc file from root?

URIs starting with a / are relative to the site root.

The behavior property requires the URI to the HTC file to be specified using the URL() syntax. Multiple HTC files can be referenced with a space-delimited list.
So suppose your csshover.htc file is in csshover directory and you can reference multiple HTC file or specially same file but from different directories
like behavior: URL('csshover/csshover.htc') URL('../csshover/csshover.htc') URL('../../csshover/csshover.htc') URL('../../../csshover/csshover.htc'); and so on.

Related

Is there some assistance with AJAX and PHP?

I am trying to use AJAX to return high-level calculation results. However, it appears as though the PHP file that I am pointing the AJAX call to is in the '/' root directory. Here is a snapshot of how my structure is: c:\webserver\test\webroot (this is the root directory), and then c:\webserver\test\code is where the HTML and PHP files are stored - looking to use an AJAX call to point to a PHP file in the non-root folder (which is one folder up, then one folder down). I tried a few different things, such as '../code' to move up and then over, but that doesn't work. Any suggestions?
Referencing a file location via relative paths should work - you'll just need to be sure that you are navigating FROM the correct folder TO the correct folder.
This can be a bit tricky if your javascript file is located in another folder - if memory serves you must navigate from the folder containing the javascript file, not from the folder containing the index file.
Alternately, you can use FQDM http://example.com/folder/folder/file.php to reference the file. Note that if you are on localhost, you can use a hosts file to fake-out the webserver.

CodeIgniter: How to load css file that is WITHIN application folder

It appears that this question is asked often and answered the same way: store the css files outside of the application directory and then use base_url() . "path/to/file".
However, I want to keep my css files and js files inside my application/views/ directory, because the views directory is effectively the html space, and css and js belong to that space (in my opinion).
Below is the structure that I wish for:
root
- application
-- views
--- assets
---- css
---- js
- system
When I attempt to load css files from within this directory structure, I get a NetworkError: 403 Forbidden, which makes sense because of CI's framework protocol.
But I am guessing that there is a way.
Publicly reachable files like CSSes images and JS files need to be in public directory next to index.php file. So hierarchy would be:
root
- application
- system
- assets
-- css
-- js
You can aproach to those files with hard coded
Link
or using (loaded) url helper with it's function base_url() or site_url(). Don't forget to fill correct URL into application config file.
Link
Docs.
Hey i'm going to politely push back on this idea :-)
Your application and system folders should be ABOVE the root, so they are not publicly accessible. (Unless this is a really simple application and you are not doing any database interaction, etc). They should not be considered part of the HTML or public space because you do not want the public accessing them. Set the path for them once in the main index.php file and its done.
Also i suggest renaming your system and application folders, like "system302". Over the long term it makes versioning and upgrading (and reverting if needed) much easier.

Images not loaded from js file

I have a javascript plugin that loads some images from the js file itself. I included the js file like that echo '<script src="'.base_url()."js/$js_file.js".'"></script>, the js file loaded correctly but the images not loaded. When i checked the images path from the firebug i found the path relative to the controller http://localhost/mysite/controller/images/nicEditorIcons.gif which the images is the folder that holds my images(its in the root folder).
What is the problem here? and how to let codeigniter load resources correctly?
you should add an slash "/" before any path which is calling a resource to be relative to the root site, first locale your javascript plugin which I think there is where you add the paths to the images that I think looks like images/nicEditorIcons.gif change that to look like /images/nicEditorIcons.gif to be relative to your root path I mean to http://localhost/mysite, so that way it will look like http://localhost/mysite/images/nickEditorIcons.gif instead of the URL you have shown, hope it helps.

wrong url to css files in spring and apache tiles

I'm creating REST application based on spring and apache tiles. I've added .css file and on main page it work everything. I mean when I'm on domain.com/ but when I'll go to domain.com/something/ the url is the same and it's wrong. I would have to add ../ at the start of .css file path
How can I create (by auto) correct file path on every subpage ?
Use absolute paths rather than relative paths:
href="/css/someFile.css"
rather than
href="css/someFile.css"
You must also make sure that the web app's context path is always prepended, so the path should in fact be
href="${pageContext.request.contextPath}/css/someFile.css"
or, if you use the JSTL:
href="<c:url value='/css/someFile.css'/>"

Can the sitemap files be in a folder if the sitemapindex is in the root path?

I want to have a sitemap structure where the sitempasindex file is located in the root path (example.com/sitemaps.xml) and it references several sitemap[n].xml files located in a folder (example.com/static/sitemap1.xml). Those sitemap[n].xml files link to webpages that are in the rooth path (like example.com/helloworld.html).
Is that posible? I'm asking because I know that if the sitemap.xml file is placed within a folder, it can only contain webpages that are under that folder.
Thanks!
I believe you easily have
example.com/sitemap-index.xml
point to e.g.
example.com/sub1/sitemap.xml
and
example.com/sub2/sitemap.xml
however each sitemap.xml should only contains URLs within each their subfolder. (From your question, it seems you have those sitemap.xml files link to paths in root. I doubt that works, but you could try run a small test and submit to Google. If no errors then...)
The location of a Sitemap file determines the set of URLs that can be included in that Sitemap. A Sitemap file located at http://example.com/catalog/sitemap.xml can include any URLs starting with http://example.com/catalog/ but can not include URLs starting with http://example.com/images/.
From google perspective, they should be available on main root of the website. http://example.com/sitemap.xml, When you submit it through the subdir in webmaster tool "http://example.com/catalog/sitemap.xml" google won't crawl it and always showing us pending index status.

Resources