I am not able to enable javascript in Chrome. Under Chrome javascript setting the default option for "sites can use javascript" is grayed out. Even if I add website manually under "Allowed to use javascript" the website is not loading, screenshot below.
This happened while I was trying to find a solution for another issue and followed solution from this page (the top answer), so I went to Chrome Devtools > Sources and clicked on the pause button since then the javascript has got disabled. Paused in debugger in chrome?
Note: Javascript is working fine in other Chrome Profiles. The issue is with this particular Chrome Profile.
Try right-clicking the "Sites can use Javascript" option, and inspect element:
Then, remove the disabled or disabled="" attribute from whatever element the console brings you to.
The option should be enabled. Click it and try reloading your site again.
If this doesn't work, you can try reporting any problems for whatever chrome has (I use Mozilla Firefox and I know they have a help center).
Or try re-installing the browser, because some files may be corrupt (don't worry, if you have an account you can sign-in after the reinstallation and everything should be synced).
I'm a complete newbie here. I have been trying to learn to code a site with HTML/CSS/JAVASCRIPT.
I am using brackets to code the site. The site I am practicing with renders properly with all css and javascript.
However when I open the .html file into safari or firefox it does not display correctly. I think it is probably a css issue as the html elements are all there.
I have other sites that I have made before that don't have this issue and I can not see where I have gone wrong.
jsfiddle.net/fs4g55m2/1 I'm using fullpage.js as well. If you notice the navbar works perfectly well. It seems to be the css after it that is corrupted (once you get to the body tag).
If you think it is CSS (and you are linking to external CSS file) try look into the network tabs in your browser's developer console to see if it is properly linked. Check to see if requested css file throw back 404 status (not found) - usually highlighted in red.
In chrome or Firefox (not sure in safari) right click on your web page and click inspect element - then choose network tab.
Hope that helps
I have input[type=file] with log-in form on it. So after user logged in - file upload dialog instantly opened.
In all browsers I need (FF, IE10+) except Google Chrome, this call works perfect:
$('input[type=file]').click();
or
$('input[type=file]')[0].click();
or
$('input[type=file]').trigger('click');
Did anyone met this problem? If so, how to achieve this on Chrome?
Edit1:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.click here in support it's said that I can use it on input[type=file].
Also this click is working, but only if I'll actually click something, that than is clicking my input(so only after physical click).
Edit2:
And yes, I've already tried search function. But everything I've found was old, and pretty much anyone told, that even FF is not supporting this (which is not true now).
Edit3:
Example test page: http://jsfiddle.net/Ux3t4/
This is not allowed due to security reasons. By the way, even in Internet Explorer (the dialog will be shown but once you select a file, the file won't be submitted).
<input type="file"> in IE6 when I write something in field text area it is writable but not in firefox and chrome. I want to open browser window in IE6 on clicking on text field area as same as Firefox.
The file input field's look and feel and behabior are different from browser to browser. It's not easy to change this. You are better off using a plugin that hides the file input field and replaces it with a custom one. Like the one here - http://plugins.jquery.com/project/jquery-prettyfile.
With jQuery you may also try the following code -
$('input[type="file"]').focus(function(){$(this).click();$('body').focus();});
I don't have IE6 so can't check it; but it works on IE7 and 8.
This is basically and simplified what I have now:
<style>
form.noshow { height: 0; overflow: hidden; }
</style>
<form class=noshow target="SomeIframeThatExists">
<input type=file id=uf>
</form>
<a id=uflink href="/user/photo">Upload photo</a>
<script>
$('uf').addEvent('change', function(e) {
// alert('oele'); // this would work fine
this.form.submit(); // auch in IE > "Access denied" exception
});
$('uflink').addEvent('click', function(e) {
$('uf').click(); // opens file dialog in all browsers inc IE
return false;
});
</script>
What it does (perfectly) in Chrome 11 and FF 4:
The form is hidden.
You click the link
Choose file dialog opens
You select a file
Dialog closes
Form is submitted
Script in iframe is executed and photo is replaced
Very hightechlike and sweet.
In IE, all of that works, except [6]. The form isn't submitted. Javascript error: "Access denied". Doesn't matter how the form is invisible, as long as the dialog was opened with input.click() the form can't be submitted on change. (The onchange function is executed fine. The error only occurs when form.submit() is called.)
Now all of this I can accept. IE sucks. I live with it.
My solution so far was to check the navigator for "MSIE" and then when clicking the link instead of opening the dialog, showing the form (with the file input). Then the user has to click the actual, ugly file input and then everything works fine. But ugly.
The question is twofold:
Is there a way to do this in IE as cool as it is in Chrome? WITHOUT nasty flash/java crap. Only html elements andjavascript.
If not: is there a way to check for form.submit() support after opening the dialog from a link (besides !navigator.contains("MSIE"))?
[2] could be catching the "Access denied" exception thrown in IE, but then it's too late: the user has already opened the dialog and browsed to the photo. You don't wanna make him do that again. (Even IE users don't deserve that.)
PS. I'm only interested in Chrome 10+, Firefox 3.6+ and IE8+.
PS. Might be important: the file input element can't be anywhere near the link, because the link is inside a form and that form is (must be) separate from the file upload form.
UPDATE
Second best: detect support for this high-techlike behaviour that only doesn't work in IE. I don't wanna use navigator.appName.contains('MSIE') because that's not flexible and not necessarily true.
#Rudie, up here - Thanks for that code! It works great in IE and Chrome, but not in FireFox.
I managed to take my old code (That works in FF and Chrome) and combined your code for MSIE.
Check it out here:
FIX FOR IE, CHROME AND FIREFOX
https://gist.github.com/4337047
PROBLEM:
When an file-input is opened via a scripted, forced click() event, IE won't let you submit the form.
If you click the file-input via your own mouse (what we don't want), IE will let you submit the form.
Please note that IE11, as of now, is allowing the form to submit if a file input field has changed via a scripted 'click' event.
Solution
(partly thanks to Rudie # Stackoverflow, https://stackoverflow.com/users/247372/rudie , http://hotblocks.nl/):
Make a label for the input in IE. If you click it, it will force a click on the input field - and IE will accept that (dumbass IE thinks user clicked the input field, hah)
So in that label we'll put our own styled DIV.
Next problem was, this doesn't work in FF. So we made a simple (possible nasty) browser check, and based on the browser we'll show a different button.
Solution is right here. Tested in:
Win 7 x64
FireFox 13.01
Chrome 23.0.1271.97 m
IE9 in regular IE9 mode
More tests / additions to code are MORE than welcome!
EDIT:
To quote Roy McKenzie
IE11 is now allowing the form to submit if a file input field has changed via a scripted 'click' event.
I did it!!
http://jsfiddle.net/rudiedirkx/8hzjP/show/
<label for="picture">Upload picture</label>
<input type="file" id="picture" style="position: absolute; visibility: hidden" />
IE8 works. I don't care about others.
So easy =)
Strange indeed, IE8 block the submission only if there's enctype="multipart/form-data" in the form.
One workaround that worked for me locally is adding "real" submit button e.g.
<input type="submit" id="btnSubmit" value="Submit" />
Then have such code to submit:
$('btnSubmit').click();
If this works you can probably hide the button with CSS to make it transparent to the user.
Well, this is the EXACT same problem I'm having right now. And only (disgusting) hack that did solve is to make the input[type=file] quite big with CSS, make it alpha=0 and put it on top of your intended UI element.
In short, you're making the user click the ugly "browse" button without him/her realizing.
Try adding the tag enctype="multipart/form-data" to your form element.