Show field when there is input? [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
So here's what I'm trying to achieve. http://codepen.io/ifen/pen/mBcCo
In mine http://jsbin.com/jafiwani/1/edit , when I enter something into the form and move on to the next, the box closes up and shows the default name. If you try to put anything into both forms you'll understand what I mean. Any help would be great, I've tried everything I know.

You're just missing jQuery from that jsbin. If you go to "Add Library" at the top and add jQuery 2.1.0 you'll see that it works!
n.b you should always check out the javascript console (available in all browsers by viewing the developer tools) for any javascript errors to see what's going wrong. In this case it says:
Uncaught ReferenceError: $ is not defined
This means that the jQuery library that much of the code here depends on (see anything with a $ - that's jQuery in action) is missing.

Related

Why Visual Studio Code did not highlight 'this.***' unused variable? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
If writing in Visual Studio code you make a mistake it is often highlighted:
Visual Studio code does detect:
wrong class name (NotMyClass)
wrong local variable (pp2)
wrong function name (rect)
But it does not detect anything wrong if it starts with "this". In particular "this.p3" does not exist. And even when I open the site in the browser (after fixing other mistakes) it executes "well" and instead of "this.p3" I get (I assume?) 0 and no any error log...
Why is it so? Any chance teaching it to highlight this mistake?
P.S. I'm from C#.NET world and relatively new to JS/TS so please educate if I miss something basic.
Yes, ASDFGerte is right, it is indeed JS ... I made JS work inside of Angular application (don't ask why, I'm learning and playing) but forgot this is JS and not everything from TS applies to JS.
I guess the answer is: don't use JS. Thanks all!
P.S. Also, many thanks for other hints

jQuery $(document).ready suddenly stopped working [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I'd like to ask about sudden stop of jQuery. Originally I used $(function(){ ... }) but it just stopped working, even though jQuery still works inside of angularjs functions. I tried rewriting it as $(document).ready(function(){ ... }) but it still isn't working.
Any idea of how to fix that?
You may want to use the Developer Tools (F12) within your browser to check the Console and Network tabs to see if any errors are present or if any 404s are popping up due to your jQuery library not being able to be accessed properly.
This could easily be caused if you are loading the files from a CDN and there is an issue with your connection (or the CDN). Additionally, you'll want to ensure that you aren't calling your $(document).ready({...}); call until after your jQuery <script> file has been referenced

Firefox returning incorrect JSON using JQuery [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I am trying to make a post to an API endpoint. It seems to work in safari and chrome even ie. But firefox seems to want to add a double quote to the beginning and end of the json string. I dont know that this is a huge issue to most of the community but I am under deadline and this is the only thing keeping me from hitting my target.
console.log(JSON.stringify($('FooObject').serializeObject()));
This returns
"{"key":"value"}"
I need
{"key":"value"}
Any suggestions? I have trolled the net for about 3 hours and no dice.
Please be nice I do not do js often, more than often I do networking and security this is a edge case that I need tackled.
Thank you in advance.
If the double quotes display in the Firefox console- then quotes are just to signify that it's a string.

SyntaxError: Invalid regular expression: missing / [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Improve this question
According to http://www.regexr.com/38o5d my reqex seems to work, but when I implement it into my javascript
var prefix = hash.replace(/\/|#/g, '');
I'll get the following error: SyntaxError: Invalid regular expression: missing /
Psychic debugging: Your code isn't in a plain JavaScript or HTML file, but is being printed from a scripting language in which # is a comment character. The #/g, ''); piece is being treated as a comment in your script.
You need to add some quotes to ensure that the whole line gets printed.

GigaPixel panorama in HTML 5 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I'm looking to build a gigapixel panorama in HTML 5 and Javascript. Similar to this one - http://visualise.com/panoramas/ipad-and-iphone-html5-gigapixel-panoramas
Any ideas of places to start or any APIs to look at?
Thanks.
Well, firebug is your friend with this. It turns out that the site uses 'panopress' which luckily turns out to be free - http://www.panopress.org/
Unluckily, it also turns out to be a Wordpress plugin - you could however have a look at the associated javascript and work it out from there . ..

Categories

Resources