FAQ Database Discussion Community


How can I have a different behavior in this JQuery script if the browser is Chrome?

javascript,jquery,html,css,browser
I am absolutely new in JavaScript and JQuery and I have the following problem. I have to modify a JQuery script so that it has a different behavior when the browser is Chrome. This is my script: $(document).ready(function () { $("thead.opening").click(function () { alert("INTO second function"); $(this).next().css('width', '10000000 em'); alert(modified);...

Unable to view changed text within WebBrowser control

c#,browser,text,replace
I'm trying to change/filter the text within my WebBrowser control, but it doesn't appear to be working. Here's the code I've tried: private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { webBrowser1.DocumentText.Replace("10.86.190.30","KM"); } At first I thought the DocumentCompleted event wasn't firing, so I assigned it to a button click I could...

Javascript race condition?

javascript,dom,browser
var len1 = $("div").length // can a new div inserted here? var len2 = $("div").length console.log(len1 === len2) // always true? Is it possible for some rogue script to insert a new div between jQuery calls?...

Android Stock Browser - Not responding to class changes

javascript,android,css,browser,android-webview
For my web-page, things work fine on Android API level 21. But when I test the same page against Android API level 18, some features do not work. When I toggle class "check" on .div1 with javascript. The .div2 display is not updated. Here is sample HTML and sample CSS...

Are background images loaded if container opacity is 0

html,css,browser
Does browser load elements background image if elements opacity is 0? .element { background-image: url("someurl"); opacity: 0; } ...

How can I detect when the contents of a div are unloaded?

javascript,jquery,html,ajax,browser
I have an application that navigates mostly with AJAX, and a section where a user can view information. I would like to track how long users are viewing different pieces of information. I want to assume that as long as they have the information loaded in the <div> they are...

How to change favicon right align inside the browser address bar

html,browser,favicon
I'm facing this problem and don't know how to change my image-icon address to be displayed with right align? <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/> Updated to be like this one, but there is no change <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" style="text-align: right;"/> ...

Why window or document can't be set to undefined or null?

javascript,browser
This might be a silly question but I haven't found an answer to it. Why can't we do the following? window = undefined OR document = undefined I know those are globals and are available in browsers but thinking of how JavaScript works, is it not possible? Are those re-evaluated...

rails 2.3 server running inside vagrant environment not accessible in host machine mac os x browsers

ruby-on-rails,browser,vagrant,hosts,mongrel
in vagrant I am using: box 'prorail/centos-5.8-x86_64' in vagrant i am running rails 2.3 server like: [vagrant@localhost myapp]$ script/server => Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server in my hosts file i have added this line at...

Load javascript in consecutive order after browser load event

javascript,jquery,html,html5,browser
What am I trying to do? In an attempt to speed up my website I am loading non-essential javascript after the browser load event. (So the JS files are not render blocking) This is currently functioning correctly. What is the problem? The problem is sometimes the non-essential javascript depends on...

Determine browser's default text highlight color using JavaScript or Dart

javascript,html,css,browser,dart
The browser's default text highlight (selection) background color can be overridden, e.g.: ::selection { background: #ffb7b7; } And the color is browser/OS specific. Is there a way to read the browser's default value using JavaScript or Dart?...

file_get_contents() function loads different page compared to broswer

php,html,file,browser,hyperlink
I am trying to find next page's link of a particular page(i call that particular page as current page here).The current page in program i am using is http://en.wikipedia.org/wiki/Category:1980_births The next page link which i am extracting from the current page is the below one http://en.wikipedia.org/w/index.php?title=Category:1980_births&pagefrom=Alexis%2C+Toya%0AToya+Alexis#mw-pages But ,, when file_get_contents()...

Why is it so hard to style