FAQ Database Discussion Community

jQuery - Listen to User click on the Auto Suggest Option provided by browser

This is my input box. <input type="text" class="form-control" id="contestCode" name="contestCode" required > My jQuery Snippet which checks for keyup event and paste event $('#contestCode').on({ keyup : function(){ checkContestCodeIfExists($(this)); }, paste : function(){ checkContestCodeIfExists($(this)); } }); But when the user clicks on the autoSuggest provided by the browser (Code exists for...

Cross-Browser simulator for testing

I need to test my application on several browser versions, is there any smart way to do that? I need a browser simulator in order to switch between browsers and versions.

Altering window.print() Javascript functionality [duplicate]

This question already has an answer here: Print <div id=printarea></div> only? 21 answers This question is mostly out of academic interests(and partly because I faced an issue like this before and simply found a workaround, but I want to know the proper way to do it). How does the...

Retrieving document.cookie getter and setter

I'm trying to override the document.cookie since i need to control cookie creation, but seems that getOwnPropertyDescriptor casted on document.cookie doesn't retrieve its getter and setter ( tried on chrome and firefox ). Could someone explain me this behaviour? https://jsfiddle.net/1363ktwp/7/ var obj={}; // creating a property using document.cookie descriptors Object.defineProperty(...

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

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...

Why do not these items appear on firefox browser?

I have this page: http://paul.dac-proiect.ro/ In Chrome all is well but look as displayed in Firefox. <div class="social" style="float:right"> <div id="facebook"></div> <div id="twitter"></div> <div id="link"></div> </div> .pozitie{position: absolute;top: 200px;left: 39;color:#f9f9f9;"} /* IMAGINI HOVER SOCIAL MEDIA */ #facebook { background-image: url("http://placehold.it/26x26"); width:26px; height:26px; float:left; margin-right:5px; } #facebook:hover { background-image:...

Own protocol in browser

I try to implement WebClientPrinter by Neodynamic. This library makes request by this format: webclientprint:http://localhost:1294/wcp.axd?sid=cm50pdi0tyfsm0feejnzjtsk&wcppping it is similar to this notation. javascript: method() My question is why browser know what to do with this protocol?...

Socket.IO/Node.JS execution

I'm new to both Node.JS and Socket.IO, so I decided to pick up a simple chat client as my first project. To my knowledge, it structured correctly, but I'm being thrown an object expected error whenever I try to run index.js. Anyone know what's up? (if it helps, I'm running...

How to prevent loading image from cache when the src is a redirect url to the actual image file

All: When I try to solve the problem that when load image from cache, I got some answers from this post:How to force a web browser NOT to cache images It talks about add a timestamp to the src like <img src="picture.jpg?1222259157.415" alt=""> But in my case, it is not...

How to modify the content of WebRTC MediaStream video track?

I use WebRTC in a scenario in which the client video stream is recorded on a third-party server https://tokbox.com/. I would like to put some kind of watermark in the recorded video. Investigation brought me to this page http://w3c.github.io/webrtc-pc/#mediastreamtrack and it seems that it is technically possible since it says...

Safely query size of element soon after inserting it to DOM

Is there an way (maybe an event?) to delay querying the height of element until all of the styles for it have been fully calculated, so that I know that it's height is calculated properly? In my app I need to get the height of an element as soon as...

Add possibility to launch commands from browser

I have a simple browser in python #!/usr/bin/env python import sys import gtk import webkit DEFAULT_URL = 'http://www.stackoverflow.com' # Change this as you Wish class SimpleBrowser: # needs GTK, Python, Webkit-GTK def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_position(gtk.WIN_POS_CENTER_ALWAYS) self.window.connect('delete_event', self.close_application) self.window.set_default_size(350, 20) vbox = gtk.VBox(spacing=5) vbox.set_border_width(5) self.txt_url = gtk.Entry() self.txt_url.connect('activate',...

HTML empty DIVs not well rendered by browsers

I receive XHTML documents that sometimes contain the following code: <div align="center" /> My problem is that browsers (Firefox 38.0.1, Chrome 43.0.2357.65) display this code as an opening <DIV> tag and not, as I expected, as an empty div (<DIV></DIV>). The rest of the document is, therefore, completely messed up....

Responsive HTML not reacting as expected in different browsers [closed]

So I am making a website but some weird thing is happening. Like, you can see it happen by yourself, it's pretty staight forward; try opening this link into Chrome and Firefox (for example). Chrome reacting just fine, and not Firefox. As the two files are pretty long, I pasted...

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

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);...

Can't get Python to download webpage source code: “browser version not supported”

So I'm trying to write a program that would download the source-code of a webpage in Python 2.7. The code looks like this: import urllib2 url = "https://scrap.tf/stranges/47" req = urllib2.Request(url, headers={'User-Agent' : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Ubuntu/11.04 Chromium/12.0.742.112 Chrome/12.0.742.112 Safari/534.30"}) con = urllib2.urlopen(req) data =...

Firefox and SSL pages - takes very long on certain sites [closed]

I use openSUSE 13.1 and Firefox 38.0.1. On some pages with ssl it takes minutes until the connection is established. It only happens on sites whose ssl certificate is not trusted by firefox, so that it asks you if you really want to enter the site. But even this security...

correct HTML pages won't load in IE10

I'm editing someone elses webpage for content, by changing the HTML files on the drive, adding text, comments, wtv. I'm not a web designer, so this is the only way I knew to do it. On most browsers, my changes show, but on internet explorer, sometimes it will revert to...

Google Chrome Add Bookmark Image

Recently Google have added a new interface when users click the star icon in the address bar to add a site to their bookmarks. The UI displays the page title as well as anything from the meta description element if present, but I was wondering if there's a way to...

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

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...

Is it possible to interact with an arbitrary client peripheral from a webapp?

I know a webapp can access media devices like microphones and webcams, and other hardware like a smartphone's GPS. As far as I know, that's done with tightly constrained protocols for each specific type of device. However, I have an advanced scientific camera. It is only useful with a computer...

How to detect wake from sleep in the browser on iOS/Android?

I want to be able to refresh the page when the user returns to page from a different tab or by waking the device. I could have sworn that I read somewhere that the pageshow event would be fired from the window, but that turns out not to be the...

JS Browser with pause function, help please

I wrote this program in js that goes through a list of URLs, where it stays on each page for a few seconds, closes the current window, and open the next in line. Everything works perfect, now I need it to stop/pause every 5 links. The second part of this...

How to display text in browsers tab bar in a javaserver page [closed]

I have heard of being able to display images in a browsers tab bar here: http://stackoverflow.com/questions/120420/image-icon-beside-the-site-url But I was wondering if there might be an easier way to do this for just some simple text? I am trying to display just two lines, last login and IP address in this...

Don't allow user to submit a form with empty fields in ruby on rails

I am starting use Ruby on Rails and I am having a little problem. I have a form with 3 fields, this is the code: <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <%= devise_error_messages! %> <div class="field"> <%= f.text_field :name, autofocus: true, placeholder: "Name" %> </div> <div class="field">...

Looking for tool that prevent script to become unresponsive [on hold]

For a side project I need to generate a lot of data from a WebGL Application. This Web App is mostly a personal tool and I really don't care if my browser become unresponsive (I mean, I know it will). Does someone know a browser/tool/plugin that could allow me to...

Change browser proxy settings from Python in Ubintu?

Is there any way to change the firefox and chrome proxy through a python script. System is Ubuntu or any other linux distro

Does {} consume less memory than [] for nested objects in Javascript?

I had some legacy JS code that creates a giant nested object structure with []. The code goes some like this var data = []; data ["first"] = []; data ["first"]["second"] = []; data ["first"]["second2"] = "hello"; It is about 250+ KB of javascript, which is fairly large. When I...

How can I add custom search engine to browser?

Basically what I'm trying to do is to be able to add my own "search engine" (based on PHP and Mod_rewrite) to any browser automatically. Somewhere on the Internet I found that I need to declare a search provider. How can I do this? <link>, manifest or some JavaScript?

Will Microsoft Edge support userscripts?

Did Microsoft announce whether Edge will support userscripts? Doesn't matter if via plugins (similar to Greasemonkey in Firefox or Tampermonkey in Chrome) or as an out-of-the-box feature.

Change permissions to allow PHP script in browser to execute matplotlib operations in a python script

I am running Ubuntu 14.04 with a locally hosted webpage running on Apache2. I can access index.php fine through my browser, but I want that page to display a graph that is prepared in a python script called graph.py. graph.py will execute fully when the I execute index.php from the...

Detect browser close event

I want to capture the browser window/tab close event. I have tried the following But not working: <script type="text/javascript"> window.onbeforeunload = function(){ myUnloadEvent(); } function myUnloadEvent() { alert ('Calling some alert messages here'); } </script> <body> Body of the page goes here. </body> Tried these links also but no more...

Python in Browser: How to choose between brython, pypy.js and skulpt?

EDIT: Please note I'm NOT asking for a (subjective) product recommendation. I am asking for objective information -- that I can then use to make my own decision. I'm very excited to see that it is now possible to code Python inside a browser page. The main candidates appear to...

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

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

Why is it so hard to style