relative path problem in firefox? - asp.net

I am using the javascript to popup a calendar when user click on calendar icon.
So here I am using like ../calendar/calendar.html?datetime= to trigger the calendar.html.
But when I try to test it in IE its working but not in Firefox(It's not getting the correct url path). How to solve this issue. Please let me know.
Thanks

According to the spec, the href attribute of the <base> element must be an absolute URI. I am guessing you are also using a relative path here, which IE (among other browsers) deems acceptable.

Related

Determining the Problematic CSS File in Firebug

I have this displayed in my Firebug console
"NetworkError: 404 Not Found - http://********.com/images/slider-img/ajax-loader.gif"
So it's telling me it can't find a background image. But can it pinpoint which CSS file this image has been declared as a background-image property?
I have about 4-5 CSS files being referenced in the document and the manual way of finding it out would to open each of the files and find for this image. So I was wondering if this could be avoided and have Firebug tell me which CSS file is the culprit...
Firebug currently (as of version 2.0.x) doesn't directly show you the initiator of a network request. This requires platform support, which is requested in bug 563623.
So, as a workaround you can do this:
Switch to the CSS panel.
Click into the search field at the right side of Firebug.
Ensure that the option Multiple Files is checked.
Enter ajax-loader.gif
=> The CSS panel will switch to the CSS source containing the rule containing the image value.
Notes:
There may be several properties referring to different images named ajax-loader.gif. So you should also check whether the path to the image corresponds to the one shown in the error message. (Within the search field you can hit Enter to get to the next match.)
It's not sure that the request comes from CSS. It may also come from JavaScript, e.g. through an AJAX request or by appending an <img> tag dynamically.

Chrome inline background-image lost on back-button in Chrome

I have an inline style on element on one of my templates.
- hero_image = article.hero.url(:medium) if article.hero.url
%article{style: "background-image: url('#{hero_image}');background-attachment : fixed;"}
It works marvelously for me. Except when I go to another link and the use the back button to return the page.
When I use the back button to return the page, the inspector the source is the exactly the same, but no image. When I refresh the page, same code, but the image is there. Seriously weird and annoying.
I've seen reports of this being a bug in Chrome related to background-attachment:fixed; but the work arounds they suggest don't work.
Is there a way to force (via Turbolinks?) this element to refresh?
It turns out that the issue is fixed by adding the base url to the url like so:
- hero_image = base_url + article.hero.url(:medium) if article.hero.url
%article{style: "background-image: url('#{hero_image}');background-attachment : fixed;"}
(I added a base_url helper thanks to this: https://stackoverflow.com/a/2952576/1291663)
I've run into the same problem on my app, trying to display user avatars.
There are (many) bug reports related to this particular situation dating back a couple of years, but the bug is still present as of time of this writing.
The solution I've gone with is to replace the background with an actual img tag, and than use z-index tricks to push it back.

IE Not using redirected URL for resolving relative URLs

I have a servlet that generates CSS for a given colorScheme name if it exists in the database. However, should the colorScheme not be found, it issues a response.sendRedirect() to the location of the actual file on our CDN.
This works in all browsers except for IE when the CSS contains relative links to images for icons, backgrounds, etc. Every other browser uses the redirected URL (CDN url) to resolve the relative URLs in the CSS file, but IE still uses the original request URL (servlet URL).
I can't change the relative URLs to absolute URLs in the CSS files for a number of reasons I can't go in to. Is there a way to get IE to use the redirected URL instead of the request URL for the relative URL resolution?
Sounds like more of a code design problem. Personally I don't rely on IE to do anything as it should. It always lets me down :(. I would always include your CSS from the CDN at the begining of the head using the HTML LINK tag, then let the JS import overwrite it afterword. This way your website will also look decent in noscript browsers.
As a workaround you can use css #import tag instead of redirecting to the external css file.
#import url('http://www.example.org/style.css');
Since we are processing our HTML/JS in another servlet before the call to the colorScheme servlet, what I did was check to see if the requested skin was dynamic (from the servlet) or not at this stage. If the colorScheme is dynamic, I write out the link tag with the address of the CSS servlet, otherwise I write out the address of the CDN.

Increase size of Facebook Like Button

I am developing a feature where I want to increase the size(width and height) of Facebook Like button which is getting rendere on my page.
I have tried overidding the css but it is not working as my css is loading very late.
Help required.
Are you sure you're using the correct overrides in your CSS? If I'm not mistaken, it doesn't matter when the CSS is loaded, just that it is loaded.
Be sure to check your CSS includes in the header file to make sure you're using the latest version. Also double check the classes or ids you need to override.
Perhaps you could post the code containing the like button you're trying to manipulate. If you're loading it in via Javascript you can use Firebug or other Web Inspectors to find out the actual HTML that gets inserted.
First of all, the css MUST be interpreted by the browser before the html element it refers to is loaded...
Second, the reason you can't select the button through CSS directly, is because it is rendered inside an iFrame that is controlled by the Facebook framework (you can check this out with firebug or any other inspector).
I'm not sure if it's feasible, but you have two possible ways to do it:
use javascript and the DOM to access inside that iFrame, select the button and style it.
create a button yourself, and give it the same href as the one generated originally, thus losing the fan-counter capabilities and whatever else is part of their framework

FLEX: how to correctly pass the link to a page?

I'm using
<mx:LinkButton label="www.google.com" click="navigateToURL(new URLRequest(event.currentTarget.label.toString()))" />
to open a browser window to display the website on the label of my LinkButton. However I cannot correctly pass the link.. you see the problem:
file://localhost/..myapp/bin-debug/www.google.com
thanks
The problem you're having is that you didn't add "http://" to the beginning. Most browsers can adjust for that because they're built to assume you mean http:// if you leave it out - but Flash Player won't adjust for that, since in theory you could be referring to a file on your hard drive or whatever.
Either add the http:// to your label or to your URLRequest.
Usually when defining links there are three ways they will be interpreted:
xy/file.ext is a relative reference using the current folder as the starting point. It is equivalent to ./xy/file.ext in that way.
So when you are at http://example.com/subdirectory/index.html, it get's interpreted as http://example.com/subdirectory/xy/file.ext.
/xy/file.ext is a relative reference using the host's root as the starting point.
So in the above situation the link would lead to http://example.com/xy/file.ext.
The other method is by specifying an absolute link. This is the solution you should use to navigate to a different host, so especially in your case where you want to link to google. Simply specify the full host with the protocol: http://google.com as the link target and it will work.
I'm suspecting that the text is something like "google.com" rather than an absolute url.
Try this:
<mx:LinkButton label="www.google.com" click="navigateToURL(new URLRequest('http://' + event.currentTarget.label.toString()))" />

Resources