Our Fav icon is placed in different url and we added below link in the header jsp.
<link rel="shortcut icon" type="image/x-icon" media="all" href="/siteid/_ui/responsive/theme/images/favicon.ico" />
but still browser is searching as www.sitename.com/favicon.ico randomly mainly in google chrome. This is causing the user session out issue in springs.
Any suggestions.
Thanks,
Sreenivas A.
I think to problem is you are missing the parent directory.
Try this
href="~/siteid/_ui/responsive/theme/images/favicon.ico" />
or
href="../siteid/_ui/responsive/theme/images/favicon.ico" />
Related
Please don't kill me; I know this has been asked a lot. I've read everything I can find on how to get the favicon to show properly. Nothing I've found works. Pages and pages on Google and on here.
IE8
favicons from other websites work
the tag in site.master (asp.net) is <link rel="Shortcut Icon" type="image/x-icon" href="http://sysmoddata1/etl/images/status/favicon.ico" />
have tried CTRL+5 many times.
I can navigate to the image. It just will not work as the favicon.
Help?
I'm aware this is similar to numerous existing posts but after looking at a number of others I wasn't able to solve my problem. I'm attempting to load a folder full of html files I've been supplied with. I didn't write them but I have been modifying them to integrate them into an existing system.
I've tried three ways of opening them, with varying success:
1) Simply right click on 'index.html' and go 'open with' and select a browser. This works perfectly!
2) Place the whole folder contents, unchanged, onto my server under 'public_html/cat/html' and navigating to the url 'localhost/cat/html/index.html'. This returns a '404 page not found error'.
3) The strange one. Place the html files in the 'application/view' folder, separate the included css and javascript files and place them in existing folders 'public_html/css' and 'public_html/js' and update the links to them in the html files appropriately. These now look something like:
<link type="text/css" href="css/cat/style.css" rel="stylesheet" />
If I load this page by running a function that uses CodeIgniter's $this->load->view(...) function it finds the index file but loads it with no css and with broken links to the other pages. I've explored the page source and seen that the link is exactly as above but clicking gives an error that reads "404 Not Found...The requested URL /css/cat/style.css was not found on this server".
I've attempted to use the base_url() function (and site_url()) like this:
<link type="text/css" href="<? base_url('css/cat/style.css') ?>" rel="stylesheet" />
and it yields the same result on the surface but examining the page source reveals the link line has become:
<link type="text/css" href="" rel="stylesheet" />
which seems to be even worse!
Any hints?
Thanks for reading
Try the following:
<link type="text/css" href="<?php echo base_url('css/cat/style.css') ?>" rel="stylesheet" />
base_url() functon simply return value, you should take a care for displaying returned value to output! :-)
Have you correctly configure you config file in codeIgniter ?
Or shorthand
<link type="text/css" href="<?=base_url('css/cat/style.css') ?>" rel="stylesheet" />
Then view your page source and copy the link from there to your browser, see if you can access it.
Can try this code <link type="text/css" href="<?=base_url('css/cat/style.css');?>" rel="stylesheet" />
if it doesn't work, you could try <link type="text/css" href="<?=base_url('css/cat');?>/style.css" rel="stylesheet" />
I want to extract the title image of a web page using C# in ASP.NET. I checked the windows and document objects but they don't have a property such as title. So searching for method to extract the title image like in the page tab of the Chrome.
using (WebClient client = new WebClient())
{
Byte[] favico = client.DownloadData("http://msite.com/favico.ico");
}
That's using WebClient.DownloadData. You can also use WebClient.DownloadFile if you're looking to store it.
A further bullet-proofed approach would be to download the index page and use an HTML parser to look for the <link> tag that specifies where the icon is supposed to be (could also be applied to apple-touch-icon or otherwise).
BTW, the tags I believe you're looking to parse are:
<!-- StackOverflow's implementation: -->
<link rel="shortcut icon" href="http://cdn.../favicon.ico">
<link rel="apple-touch-icon" href="http://cdn.../apple-touch-icon.png">
<!-- Google's implementation: -->
<meta content="/images/google_favicon_128.png" itemprop="image">
<!-- Facebook's implementation: -->
<link href="http://static.ak.fbcdn.net/.../q9U99v3_saj.ico" rel="shortcut icon">
There is no such a thing as "title image" in HTML specifications. The icon you see in the tab or near the URL in some browser is specified using <link rel="icon"/> construct:
<link type="image/x-icon" href="/images/favicon.ico" rel="icon" />
IE may rquire you to use a slightly different syntax:
<link type="image/x-icon" href="/images/favicon.ico" rel="shortcut" />
Parse the page - and retrieve the value of href attribute - this is the path of the icon.
Note also, that IE version 8 and below ignore this line completely and instead look for file favicon.ico in the root of the site. See this somewhat old article for more information on IE.
In my .net application i have Styleshet.css in CSS folder.
Now i want to link this css in Sample.aspx.
What would be the best approach
1.
<link href="CSS/StyleSheet.css" rel="Stylesheet" type="text/css" />
OR
2.
<link href="<%=ConfigurationManager.AppSettings["ApplicationUrl"].ToString()%>/CSS/StyleSheet.css" rel="Stylesheet" type="text/css" />
In Web.Config
<appSettings>
<add key="ApplicationUrl" value="http://localhost/myapp/" />
</appSettings>
The best way in asp.net is option 3:
<link href="~/CSS/StyleSheet.css" rel="Stylesheet" type="text/css" />
The ~/ resolves to the site path root. The difference between this and just "css/... is that it will work no matter what subfolder you're in. For example if your code was in
/subsection/default.aspx
and your styles were in folder /css
using a link to "css/stylesheet.css" would resolve (incorrectly) to "/subsection/css/stylesheet.css" whereas using "~/css/stylesheet.css" would resolve (correctly) to "/css/stylesheet.css"
This also differs from a hard path root "/css/stylesheet.css" in that it will work correctly regardless of the virtual directory configuration of the site.
<link href="CSS/StyleSheet.css" rel="Stylesheet" type="text/css" />
Dont go for second approach as when you deploy your site to a server the /localhost/ reference wont work.
Well, always use relative paths so that you don't have to change your files after the deployment.
You can also use resolved app relative path such as
<link href="<%= ResolveUrl("~/CSS/StyleSheet.css") %> rel="Stylesheet" type="text/css" />
Reletive path approch is much better (your first approch), Absolute paths are not portable between applications. If you move the application that the absolute path points to, the links will break.
You can find more information on below mentioned link
Specifying Paths for Resources
<link rel="shortcut icon" href="favicon_012423/favicon.ico"/>
<link rel="icon" type="image/gif" href="favicon_012423/animated_favicon1.gif" />
I want to pop up or open a new form on the click of a fav-icon. Can anybody help me out with this? Thanks
you can't open a link off of a favicon... favicons are outside your markup and thus you cannot add an anchor tag to it.
It is impossible because FavIcon is not a part of your code.
Your icon just download to users computer and then his/her browser try to use it in its own way.