- Upvotes Received
- 7
- Posts with Upvotes
- 7
- Upvoting Members
- 7
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
63 Posted Topics
One solution is you can check it's url. if (window.location.href.indexOf('url') >= 0) { //change logo for domain name with 'url' } else { // change logo for the other domain } or you can check it using this method if (document.domain === 'domain') { //change logo for domain name with …
I'm not sure what you really want but try this. In your JavaScript code, submit the name of your employee via form and perform an ajax call so as to not refresh the page. Requirements: jquery framework (widely used js framework that rocks!) - http://jquery.com/download/ jquery ujs so as to …
Is there a requirement whether you could use a framework like jQuery or just the native one?
+1 to pritaeas.. I suggest you also want to look at using `$('#contact-form').serializeArray()` method which will return an array of names and values from elements on your form rather than selecting your form elements over and over.
Don't you want to put your code inside the initializer? Codes inside the initializer folder only run once whenever the application starts.
Basically when you click a next button, you pass some parameters (e.g. {:page => 2}) to your backend, then your backend will then do the query on the set of data you are going to display. Let's say per page you display 10 records you do some query like this. …
In addition, that is a ternary operator in JavaScript, just want to let you know. It saves a lot of lines by the way.
First of all, you don't need to use javascript to hide the logindiv upon load of the page. You may add a class "hide" or add an inline style to make the container hidden. I'm not sure why is the logindiv is hiding after an error is shown upon looking …
Why don't you provide a class on the body tag to identify if you are on this page rather than check your current url. e.g. <html> <body class="somesite"> </body> </html> and in your javascript you do this $('#menu a').each(function() { if ($('body.somesite').length) { $(this).addClass('current'); } });
Use "this" this - refers to the element who clicked it or you may use the event obj. e.g. (this) console.log('element who clicked', this); e.g. (event) $('.clear_all_slip').click(function(event) { console.log('target', event.target); });
I agree to AleMonteiro and gon1387, you should try using what they suggested. Make sure the elements are loaded first before manipulating them.
Badoo has a better way of making those images protected, how, they add some text on the images they render.
Where is the problem coming from? is it from the backend side or the js side?
Looking at the code, I guess you shouldn't provide the "value" attribute unless you placed something other than an empty string. I'm not sure if that would help though. Another tip, it's a best practice to always validate required fields on your backend. It is not safe to just put …
have you seen the console log of IE's web development tool?
I'm not sure what the problem might be, but window.location.href = "http://www.friendster.com" is absolutely working fine across browsers.
you could use jquery.validate plugin. You can set different ways of displaying your validation. It's pretty handy and you'll have a consistent look and feel of your validations across the site. http://bassistance.de/jquery-plugins/jquery-plugin-validation/
I'm not sure why would you want to use JavaScript for making a dropdown. You can use css for this one. But here's what you need if you need a script. This is a sample markup: <div id="link-wrapper"> <a href="#" id="link">Hover to show div</a> <div class="hide" id="some-div"> <ul> <li> <a …
Ruby is the best, use Rails it's a web framework and it's super easy to implement. It will change the way you code and it's community is growing bigger. Most of the projects in github are written in ruby :)
here's an article regarding your question that might help you understand primitive vs object data type http://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives/
That's weird, can you send us the link of your site so we can see it in IE?
You may override the default containers for the validation which might help you manipulate the provided error message with your own styling. $('.contact').validate({ errorClass: 'invalid', errorElement: 'label', wrapper: '<div class="error-inline" ></div>', }); probably the plugin has default css or markup which causes it to have line breaks
What kind of modal window do you want to reload? What are it's content? Be specific, precise and tell more details of the things you want to happen.
JavaScript is an essential part of a web site, I think there are no more supported devices that are aren't using JavaScript. just refactoring some code above, but that really works even without testing: $("a.someclass span").click(function(){ window.location.href = $(this).parent().attr('href'); });
That's huge bro.
are you submitting the form via ajax? bring in the code bro
you could jQuery's extend method. var obj1 = {"cool":"34.33","alsocool":"45454"}; var obj2 = {"coolness":"34.33"}; $.extend(obj1, obj2); The value of the first object will contain obj2. console.log(obj1); The above statement will log something like this: {"cool":"34.33","alsocool":"45454", "coolness":"34.33"} If you don't want to use jQuery, you can try the native and easy way …
like_add.php is inside the folder ajax in your server. it will handle your ajax request, it is the backend of your ajax call.
using jQuery it easy to get what you need. <tr> <td><?php echo $entry_shippingtype; ?></td> <td> <select name="type" id="category"> <option value="free">Free Shipping</option> <option value="flat">Flat Rate Shipping</option> <option value="weight">Weight Based Shipping</option> </select> </td> </tr> <tr> <td><?php echo $entry_shippingamount; ?></td> <td><input type="text" id="shipping-amount" name="shippingamount" value="<?php echo $shippingamount; ?>" /></td> </tr> On load of …
use oauth gem http://oauth.rubyforge.org/
Open a chrome browser and press Ctrl+Shift+I. Then go to console tab and paste your code and hit enter, that should do it.
looking at the code I guess the "coke, pepsi" is not a property of array.drinks object. It's a value of the array.drinks property. If you want to get pepsi or coke, you can try sepp2k suggesstion of using a split method for strings.
getContext is available for html5 only. You should declare the doctype on top of your file. <!DOCTYPE html> <html> <head> </head> <body> </body> </html> hope that works
JavaScript is not as strict as C# or probably java in terms of initializing an array with a specified number of elements.
I'm still kind of confused with what you want to happen. But here I go, if you wanted to redirect a page using a javascript function, you may call window.location.href = 'url'; Then once you've redirected that user to the page and wanted to run some javascript function base on …
What is the response you see when you log the response? Check the response in firefox using firebug or chrome's development tool. My guess is, the mail function probably returns some value which adds another response to the 'success'.
you should trigger the plugin masonry again to resort the page. you can specify a callback function for infinite scroll e.g. $('element').infiniteScroll({}, function(newElements) { // newElements are the set of elements fetched after ajax call // you may retrigger masonry to resort the new set of elements added. var $newElements …
Basically the server is responding with an ERROR that is why every request you did alerts an error message. Check your url in your AJAX call, are you really going to use the value of the input? Why not put the url on some data attribute
Use firebug in firefox or chrome's web development tool, see the console tab and you can see the specific error occured.
is it possible to access an Iframe without a source in IE8 and setting it's content? (e.g. iframe_obj.contentWindow.document) For example I wanted to get the head tag inside that dynamically created iframe: iframe_obj.contentWindow.document.getElementsByTagName('head') Then setting it's content: iframe_obj.contentWindow.document.getElementsByTagName('head')[0].appendChild(dom_obj);
use jquery cookie plugin, it's easy to set and retrieve a cookie. https://github.com/carhartl/jquery-cookie it's almost 2kb only. Set an expiring cookie: $.cookie('the_cookie', 'the_value', { expires: 7 }); Set a session cookie: $.cookie('the_cookie', 'the_value'); Retrieve that cookie: $.cookie('the_cookie'); Delete that cookie: $.cookie('the_cookie', null); So simple yet effective. You can store any …
Does anyone knows how to make a particular website their default home page when they click the button "Make this site your homepage" using javascript. This sample code works in IE, but other browsers doesn't know this code. [CODE] this.style.behavior = 'url(#default#homepage)'; this.setHomePage('http://localhost/getuptodate/php/getuptodate.php'); [/CODE] Could someone help me in figuring …
Hi guys, I have a page and inside that page I have an iframe which occupies 60% of the page. Now inside this iframe, I have a button that when i click it, it opens up a [B]modal box[/B]. I am currently using jquery ui modal dialog, could anyone help …
I can't see comment on your code. it's purely images.. and you are using a table. Never use a table in your html layout. Use the div tag instead
try SNIP I think it's the fastest free web hosting site, give you bigger space than any other web hosting sites.
try this.. 1. Reboot your system 2. Press F8 and go on to safemode 3. Login using the administrator account 4. Go to control panel and look for the useraccounts or right click my computer then go to manage, then look for the users and click on your useraccount. Right …
Do you know callback in JavaScript? Using callbacks you can popup a form and after it focusing on a particular element. Callbacks are functions executed after performing a particular operation.
Hi, I have done this before, writing a text on a diva.. wow, it's really cool. So how would you do that? First, you must have a div element and a form with an input type text. You must set the width and the height of the div element to …
jquery has its own ajax function, you could try it instead of using a dll file. I do not recommend you to use the '$' alias for jquery function. Instead, declare a new jquery alias variable, let's say var j = jQuery.noConflict(); - this is now equivalent to jQuery(selector); = …
The End.