"best practice" for js namespaces?
Hello, is there a general "best practice" for creating namespaces for objects in js? Ideally, I'm looking for an approach that will work for all scenarios, including all browsers, using the least amount of code, written in the most elegant and maintainable way. Ideally, I'm looking for the most universally acceptable approach that will be least likely to break.
jquery and regex
Can any one point me a good tutorial on regex expressions in jquery.
Preload in the background of 2mb
How to load the page only when such image is loaded? I tried: $ ('# IDdaImagem'). On ('load', function () { / / 'Code paragraph load a page / content' }) and the image still does not work after being charged ... is a background image, and use a jQuery plugin to open in other resolutions, the backstretch, it uses a div with class backstretch, as I carry this Background with 2mb before the site content? i test this and work, but not the item that I give show, appearing at the time, it works
jquery $(document).ready() - proper shortcut description?
Hello, the following jQuery function will get called as soon as the DOM becomes available: $(document).ready(//myfunction) The following syntax is a shortcut: $(//myfunction) However, (//myfunction) is just a standard javascript anonymous function aka IIFE (Immediately Invoked Function Expression). So is it technically correct to simply say that "$" is a shortcut for $(document).ready()? If so, then what is the proper technical term for "$" in this scenario? Would this be described as a jQuery scoping
jsonp cross-origin xhr value, syntax error
I am trying to get xhr value from some router by using jsonp, I want to parse the incoming data. The return data is not in json type and it is naturally giving a "SyntaxError: missing ; before statement". The code is: $.ajax({ type: "GET", url: "http://192.168.xxx.xxx/index.cgi?page=modemStatusData", dataType: "jsonp", success: function(data){ console.log(data); } }); xhr data is: 0.0.0.0##00:A0:BC:42:F6:A5##UT_1.2.1.5.1##UT_7 P3_V1##Scanning##160,871##21,445,571##95,556##14,413,556##000:00:00:00##0##0.0##10%##283713493579##0.0##100%##N/A##0%##Inactive##N/A##0%##Single##1113450013##images/Modem_Status_005_Scanning.png##/images/Satellite_Status_Orange.png##
variable declaration
--------html file for drag&drop--------- <div id="dropbox"> <span class="box">Drop images here to upload. </span> </div> ------------------html end-------------------------- ------------jquery file--------- 01 var template = '<div class="preview">'+ 02 '<span class="imageHolder">'+ 03 '<img />'+ 04 '<span class="uploaded"></span>'+ 05 '</span>'+ 06 '<div class="imgHolder">'+ 07 '<div class="img"></div>'+ 08 '</div>'+ 09 '</div>'; var preview = $(template),
Is there anyone out there that can tell me what this does or translate it?
lookup: citiescount, onSelect: function (suggestion) { this.value=suggestion.data; document.getElementById("qsubmit").click();
Select2 3.4.6 usage
Hello all, I am trying to figure out how to implement a jQuery plugin of Select2 3.4.6 http://ivaynberg.github.io/select2/#documentation on my website. What I am trying to do is Multi-Value select box select values from a field from my MySQL database. Is that possible with Select2? If so, how can I implement it?
JQuery newb stuck with a slider
Hi everyone, I'm hoping I might get some help with this, I'm completely stuck. I have only learned HTML/CSS in the last two months, and I'm trying to get to grips with JQuery. I am trying to make a slider, but the behaviour of it is erratic. I want the text to slide to each link, but it is not. Here is the code I have: <ul class="pure-paginator"> <li><a class="pure-button prev" href="#">«</a></li> <li><a class="pure-button" href="#home">1</a></li> <li><a class="pure-button
Checkbox ShowHide Disable
Hi all, I've three controls 1- CheckBox1 2- TextBox1 3- DropDownList1 now when the CheckBox1 is checked TextBox1 should be visible and DropdownList1 should be disable $(document).ready(function () { showHide("CheckBox1", "TextBox1") showHide("CheckBox2", "TextBox2"); showHide("CheckBox3", "TextBox3"); }); function showHide(Selector1, Control1, Selector2, Control2, Selector3, Control3) { $("#" + Selector1).change(function () { $("#" + Control1).toggle($(this).prop("checked"))
Having issue with click() event
Hello, I'm new in jQuery. I wrote simple code to add then remove Class after Click Close button but it not working. First, you need click on div.item, after that, when I click Close, every will return original. I read delegate the events by on() method but donot know how to use in my case. Here is my Fiddle: http://jsfiddle.net/gaoshun92/t2TxH/ $(document).ready(function(){ $("div.item").click(function() { $(this).addClass("open"); $(this).find("a.close").removeClass("hide");
Handle click() with element have the same class
Here is my JSFiddle Hello, I am new in jQuery. I have trouble when using the same class in element. I have 3 DIV.item, when I click each of them. DIV.container > h2 inside add Class .red (only in element I clicked). I using class because I want when I show them up from database, they have the same style. My project is more harder than this but I think I will understand with this small example.
Close div and stop youtube displayed in that div
Dear All refer http://webvikas.net.in/mahesh/ Click on any link specified below Sample Video A video from youtube is displayed in DIV If close Div the video keep on playing (you can hear voice) this is because the div is close but the youtube video is not stopped. How can I stop playing of the youtube video when a user click to close the DIV Sample videos Click to view 1. About this Channel 2. About UPSC Civil Services exam. 3. History basics Part 1 4. History UPSC question answer 5. Subhashchandra
I need a help with 2 slides in same html
Hi, In my site i try use two slides in same html, look the codes: Html: <figure id="slide"> <img src="imagens/banner_01.png" alt="Microprocessador Acadêmico em Protoboard"> <img src="imagens/banner_02.png" alt="Diagrama Geral do Circuito do Microprocessador"> </figure> css: #slide { width: 300px; overflow: hidden; height: 200px; box-shadow: 0 0 2px #999; position: relative; /*border-radius:3px; */ /*border-bottom-left-radius: 3px;*/ /*border-bottom-right-radius:
an animation for one block at the time
Hi friends, I need your collaboration to complete my work: I have a number of blocks and I want to implement an animation for one block at the time.The order of choosing the block,animation,and the duration will be randomly. I get this problems: I want to apply the animation for each block ,then initial the d array which saves the indexes of the blocks which affected with the animation, to do that again,but there are some block didn't aminate,while the array filled. how to wait for some seconds
Post notification message in the android notification area
how can one post notification message in the android notification area
Very Noobie Question
Hi All, I have an asp application. On one asp page, I have a div into which I want to load a file dependant on a javascript OnChange event (in a dropdown box). I can do this easily with ajax.updater but I cannot achieve this simple operation with jquery! I've tried the examples on various jquery sites but nothing works. I know I am missing something simple, but what? Can someone please give me a simple example showing the links to jquery in the header and the function? Cheers Gary
Slider not working in Internet Explorer
Dear All I am referring to https://forum.jquery.com/topic/slider-is-not-looping and http://jsfiddle.net/u9Ndr/ This is great solution from cold fusion coldfusio.. http://james2013.batcave.net/loop_it_with_text.htm Based on this the jsfiddle was made however diesnot work in Internet explorer Pleas help
ajax loads content how to submit form
Hi I have made so that my content is loaded with ajax like this and placed in a div <ul id="navlist"> <li><a href="home.php" class="home">Home</a></li> <li><a href="gallery.php" class="gallery">Gallery</a></li> <li><a href="upload.php" class="upload">Upload</a></li> </ul> <script> $(function () { // attaching click handler to links $("a.upload").click(function (e) { // cancel the default behaviour e.preventDefault(); // get the address of the link var href
prev/next buttons from date pick calendar
Hi, I don't know why I can't see the prev/next buttons from the calendar, can you pls help? Thanks <link href="css/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="/js/jquery-ui-1.8.2.custom.min.js"></script> <script src="js/grid_tool_bar.js"></script> <script type="text/javascript"> $(function() { $("#to_date").datepicker(); $("#from_date").datepicker();
get CSS z-index
// Test $ ('Body') CSS ("z-index", 111); alert ($ ('body') CSS ("z-index")); / / return auto alert ($ ('body') [0] style.zIndex) / / return 111 ?????
to create popup window
I need to create popup window and in that i need to submit some values and that value should be stored in database.. how to do this friends.. i need coding for this
celsius symbol
Hi, I wanted to know how can I get the celsius symbol in JQuery and present it in a .text(), something like this: $("#lblTempC").text(temp_c + " C");
simpleCart(js) - using iframe
I have a question regarding simpleCart(js). I'm new to javascript and I know there is a lot of information on simplecartjs.org, but I couldn't find the answer I was looking for. I am trying to implement simplecart into my website; which is completely written in HTML5/CSS3. I have an index.html which has <script src="simpleCart.js"></script> & <script src="jquery.min.js"></script> in the head for loading the simpleCart(js) script and the jquery library, and I have <span class="simpleCart_quantity"></span> & <div
Checkbox ShowHide
Hi all, I'm working on Asp.net web application and I'm not a good developer :( I've more than 5 checkboxes and textboxes, I wana ask when the checkbox = checked a textbox should be visible and if checkbox is unchecked txtbox should be hidden every checkbox has one or more than one textboxes I've written some code with google help. when i check the checkbox textbox get visible when i uncheck the checkbox textbox dose not get invisible. I need both function show and hide I hope you got my point is
Map not displaying in jQuery tabs (newbie)
Hi all, I think there can be a general problem with maps displaying in jQuery tabs ie that they display ok when in the first tab but do not display when in any other tab. The problem I think is that hidden content has no dimensions and so, except for the first jQuery tab, a map needs to be somehow re-triggered or resized. I have seen this problem mentioned concerning Google maps but in my case I am using Leaflet maps in Drupal. The problem and a suggested solution (not yet working for me) are demonstrated
Carousel
Hi, I have a script for a carousel (slide images) simple, and it is inside a div css you're hide (), and when I open the div hide the first time the carousel is normal, but when I go out and buga carousel and return the arrow that moves the images appear longer than it should, can anyone help me? jsfiddle.net/fDetC ---------------------- Oi, estou com um script para um carousel (slide de imagens) simples, e ele tá dentro de uma div css que tá hide(); e quando eu abro a div hide da primeira vez o
Need a bit of help
Hi All, I would like to say thank for any help in advance so the problem: I have a list item as follows <ul> <!-- Row 1:start--> <li class="mid-grey"> <div class="block"> <div class="active"> <h2>Example 1</h2> <span class="time">July 2 2013</span> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
how to serialize an array of objects.
I call toString() on a array of objects but only get s string [object],[object] does jquery have a function to accomplish this?
Change images at different (an array) times
I am creating a site where it has a slide show (presentation) but I want to slides to change at different seconds. So Image1.jpg runs for 5 seconds Image2.jpg runs for 10 seconds Image3.jpg runs for 7 seconds I know how to do it at a set interval but not multiple intervals. An example of an array of time would be great
Script does not reach the end
JavaScript (JQuery) <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="jquery.cookie.js"></script> <script> if ($.cookie('cookietopshapes')) { $("#formulario666").submit(function() { var login = $.cookie('cookietopshape'); var senha = $.cookie('cookietopshapes'); $("#buscarinput").prop('disabled', true); $("div#status").html("Logando..."); $.post('logar.php', { login: login, senha: senha }, function(resposta) { if (resposta != false) { $("#painel").toggle();
Remove filename from string?
Does anyone know if it is possible to remove filenames with different lengths from a Url? The Url could be anythng http://server/site/somepage/anotherpage/filename.any Thanks, Dan
setting Character set
I'm not even sure if I'm in the right place here, but here goes anyway... We found a little game, which according to the author was designed to show the power of JQuery. The game is an ideal tool to teach young children (7-10) proper keyboard skills. This is what we want to use it for, and the author does tell us in his blurb that we are free to modify and use it as we wish. Here's the problem: the young children in question are Greek, and we cannot get the game to produce Greek, lower case characters.
How to handle click() event to expanding width for each element
Hello, Im new in jQuery. I write 1 small JS to change DIV width after click for each DIV in LIST ORDER. But I want when I click on another DIV, prev DIV will return default width, and the new one I clicked apply the new width. Here is my code.http://jsfiddle.net/gaoshun92/a3bdt/
The dialog buttons do not show the text.
The dialog buttons do not showing the texts: Submit, Cancel. $(function () { $("#dialog").dialog({ resizable: false, height: 350,width: 500, modal: true, buttons: { Submit: { text: "Submit", "id": "submitBtn", click: function () { $(this).dialog("close"); $("#SubmitBtn").click(); } }, Cancel: { text: "Cancel", "id": "cancelBtn", click: function () { $(this).dialog("close"); } } } }); });
Need to remove .00 in the gridview cells
Hi All, I have values in gridview as "123.00", "124.23". I want to truncate every thing after decimal. i.e., 123.00 should be 123 124.56 should be 124 Can anyone help me here. Thanks Vikram
Jquery accordion
The code below creates and deletes the content of the accordion <div id="accordion">. With the initial accordion population everything works properly ie the proper content is generated and the "accordion action" works. But once the the <div id="accordion"> is emptied and re populated all the content is correct, but the "accordion action" does not work ie everything is expanded.. Please comment Kinetic.Layer.prototype.omniLoadPropertiesPallet = function(node){ attrs= node.getAttrs(); for (key in
Validate plugin - Handling of error messages
Hi ! Can I have some help for my form please I use the validate plugin. http://jsfiddle.net/Xroad/2pLS2/23/ I would like to show a general error message only for all empty fields on the top of my form (that it's ok) and custom error message under each field (like "Please enter at least 2 characters"). How can I do that please ?
jQuery Problem with Superfish AND jquery.validate
Hi , i must use the both javascript but i isnt work together if i put the <script src="./js/jquery.validate.pack.js" > superfish work not but my validation form work if i put <script src="js/jquery-1.7.1.min.js"></script> <script src="js/superfish.js"></script> and remove <script src="./js/jquery.validate.pack.js" > superfish work but my validation form doesnt work have you good a solution ,? help me please
$ is not defined
Hi; How can I deal with this?
Next Page