How to apply selector from JS array
Hello, I'm sure there is probably an easy operator I can use to work with this, but consider the following. I have the following JS, starting from a slightly complex array of objects, that I then want to apply a selector for it. var key = "Some Key"; var someData = [ ... ]; $(someData).selector("[data-attr='" + key + "']").doSomethingWithSelection(...); I know how to work with selectors in general, and they are quite powerful. I'm not sure how to do the same when starting from known value(s) or an
How to Load a jQuery SweetModal Plugin
I was trying to override the old alert() messages: "You won!", "Computer wins!", and "Tied!" to a nice Sweetmodal plugin ( http://www.jqueryscript.net/demo/Beautiful-Animated-Modal-Window-Plugin-With-jQuery-SweetModal/ ) on a Tic-Tac-Toe game (the game is working good). Are those correct codes I did in javascript to make it work? HTML <html> <script src="action.js"></script> <style> /* UNIVERSAL STYLES */ .center { margin: auto; } body { background-color: #000000; } /* ELEMENT STYLES */ .button
Jquery button
Hi, I'm new to javascript and jquery and i want a button from jquery to run a script thats javascript when its clicked. Can someone help because im really confused Many Thanks Lucy
Question about new project - your advise please
Guys, I just wanted to ask about your advise please as jquery and jqm are separates now. I am starting a new online order project and I wanted to know if you suggest to have it under jquery or jqm? I want the project to be responsive for mobile devices so shal I make it just one with jquery, one jqm or jquery for the web and jqm for mobile then I will have separate projects for each? What's your advise? Thanks, Jassim
Why dialog is not opening
Hi, I am trying to open a dialog on id or class click but neither ways work with me and no error in chrome console. Here is the link... just try to click on the Arabic Coffee http://crockeries.meskholdings.com Thanks, Jassim
v1.4.5 google map not refresh
The issue: When you click on 'Open Demo' of this official Jquery mobile 1.4.5 page: http://demos.jquerymobile.com/1.4.5/map-geolocation/ You get a google map. Then when you scroll down to the bottom of the map, leave the scroller's position at the bottom, then hit the browser's back button to return to the demo page. Once at the demo page, you click on 'Open Demo' once again. Once again, you get the same google map and the same scroller's position: at the bottom. I found this issue first occurs
Responses to Issues in jquery mobile github
Hi, I have posted an issue in github project and I'd like to know if somebody knows how long take to receive an answer about it, more or less. Thanks in advance, Félix.
Setting an active menu item based on the current URL with jQuery
I am trying to replicate this but the code is not working can anyone please help ? Here is the website with the code i want to replicate http://www.itworld.com/article/2832973/development/setting-an-active-menu-item-based-on-the-current-url-with-jquery.html Here is my website http://www.cuevadesigns.net/sample_site/home.html The css file http://www.cuevadesigns.net/sample_site/site_nav.css The two javscript files i am using http://www.cuevadesigns.net/sample_site/jquery-2.2.3.js http://www.cuevadesigns.net/sample_site/navigation_func.js
Why is the button click event handler in the dialog not firing?
I have an adjunct dialog for my page that I invoke when I need to let the user add additional (more than three) email addresses: <button class="btn" name="btnAddlEmail" id="btnAddlEmail">Add Another Email</button> . . . @* modal input form which remains invisible until the link (addlEmails) is clicked *@ <div class="modal fade halfwidth" id="add-email"> <div class="modal-header"> <a class="close" data-dismiss="modal"></a> <h3></h3> </div>
Change image every scroll
Hi guys, I am trying to implement a script which changes images "every time" user scrolls down. It means I have 40 images (for example) and I wanna do the following process: 1) first image showed; 2) user scrolls once and the image switches to another one; 3) user scrolls again and the image switches to another one; 4) user scrolls again and the image switches to another one; ... 40) user scrolls last time and the image switches to the last one. I suppose to use the "scroll" function, but I am not
What is a less verbose way of checking for null?
I had this function: function populategeneratevals(generateddata) { var domOrdinalified = ordinalify(generateddata.generatevals.DayOfMonth); $("#dayofmonthselect").val(domOrdinalified); $("#ordinalselect").val(generateddata.generatevals.PatternOrdinal); $("#dayofweekselect").val(generateddata.generatevals.PatternDOW); $("#weekormonthselect").val(generateddata.generatevals.PatternInterval);
Overriding JS Alert() with a simple dialog box message
I built a tic tac toe game and it works OK, but Im trying to override Alert() by putting a basic dialog window divs in HTML (to display "You won!", "Computer wins!", and "Tied!") and JS calling IDs like this and it seems it doesnt work. I didnt want to mess up the javascript with the jQuery. HTML <!DOCTYPE html> <html> <script src="action.js"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script>
How to disable select option based on other select options?
I Have a code like this first select box <select id="1"> <option value="a ">a</option> <option value="b ">b</option>and other select box like this <select id="2"> <option value="a ">a</option> <option value="b ">b</option>Whenever user select an options from select id 1 just say it is 'a' then user should not able to select 'b' from the select box 2. I am having really a hard time using jquery. Any help would be appreciated. Thank you.
perform delegate even if its not set !
im writing a menu component like $(".sample").menu(); it first clones $(".sample"), hides the original, and does the rest job on the cloned html thats becoz i want to keep the original html tags to have "unMenu" option like when $(".sample").menu("unMenu"); is called, every thing get back to the first day now ! i want to keep the js events that some one else has allready written on $(".sample") ! ie some one may have written $(".sample li a").mouseenter(function(){ $(this).addClass("hovered") });
Ajax- status 200, without data, in response is NOT considered as request success
Currently, In case of an Ajax request, if the server responds with status code 200 and do not send any data in response, it is considered as an ERROR. Expectation It should be considered as SUCCESS and trigger done handler of the ajax object.
jQuery textillate.js Animation HELP!
I would like to know how can I do (simple piece of code to add) to make textillate work when each anchor (each flipping image box is inside an anchor) is active or current and not when to work all together when the page loads. http://www.ccttxx.net/testara-ubp/ HOPE YOU CAN HELP ME.
Hi this is Raghav Facing problem with JQplot plugin
Dear, I am facing problem while giving 3 different colors to my grid in jqplot. I used fillbetween() method to fill different colors to 3 different portion but it doesn't works. My requirement is to color grid in jqplot with different color. please help with this.
How to make two DIVs/Elements collide? (not go through other elements)
I am using an animated DIV to make a game to practice and learn new things with coding. My current issue is creating collision. My page consists of elements (Canvases and DIVs). The canvases are not moving (of course). The DIVs are moving. How to I make it so that the DIV that i am controlling will stop when it hits the canvas or the other moving DIVs?
10 hour efforts failed: [Ajax response into $(div).html] DOESN'T work
If I set $_SESSION[''] in php file, it works on index7.php. But I want to know it can work using Ajax response. [question] What I want is just to make $("#letters").html("fjejief") work. cf. Please change the extensions of attached files from .txt to .php. My guess: Ajax and session and show() are messed up with each other. --------------------------------------------------------------------------------------- index7.php -> signin_process7.php -> index.php -=====================================================
Animation
So i've just started out with this and i'm kinda stuck .. I'm trying to animate a progress bar by taking the % value from the div attribute. So far i have animated it to my requirements with this simple code $(".progress-bar").animate({ width: "75%" }, 1000); This obviously works perfectly until i need multiple progress bars with different values, so what i want to do is use a script to obtain the ariavalue-now attribute value <div class="progress-bar" role="progressbar" aria-valuenow="65" aria-valuemin="0"
Content box in sortable list?
I am using jQuery draggable and sortable list for the first time and it seems the sortable list is working. However I have a question. When I try to drag the content box with custom CSS applied to the sortable list, the div goes into the list, but loses all the styles. Is this a normal behaviour? Is it possible to keep the styles when dragged into the sortable list? Here is the jsFiddle I put up: https://jsfiddle.net/3fa24d0p/ Thanks in advance.
Validate plugin: custom validator always returning alert message
I have created custom validation to make sure that the value being passed only contains letters. In the code below, I purposely put "abcde" to give it a basic test but the result is the same when I test it against the a real passed value. As the code sits right now, I DON'T expect see "letters only please" returned. By changing the test string to "ab56cde" I would expect to see it. The problem is, no matter what I change the string to I still get the alert message returned which I assume means that
Close event in Ajax
I have a Modal Popup on my Page. Usually, when a Modal pops up the entire background is blurred but I have a scroll button that shows up on the Modal Popup. I used fadeOut() on it when the action completes so it doesn't appear on the Dialog box. Now what I want to do is, to find out if this popup was closed so I can show that button again using fadeIn(). Is there a way I can know when My Modal Dialog closes so I can show the scroll button again? Here is how I faded it out: function CallOfferRenderAction(productCode,
Table header floating issue
Hi, I am using latest version of Jquery mobile for my project. I have used HTML table to populate the data. when i scroll the page the table header should be visible below the header. if remove the jquerymobile js it working fine. issue I can't float the table header, When I scroll the page table header should be visible on the top. demo project is attached. Thanks.
Replace javascript alert box with Jquery Popup
Hi, I'm working on a .Net application. On my .aspx page, on click of a submit button i'm calling a javascript function. Inside the javascript function I'm using an alert box to show to the user what all values he has entered. I want to replace this javascript alert box with jquery pop up and in the pop up i want to pass dynamic values. Can someone please help me replacing javascript alert box( called within a javascript function) with Jquery Pop up with dynamic values( whatever user has entered in
Date picker Error
Hello all supporter, I have the problems related to the use of date picker. the below is my code: <script type="text/javascript" src="~/Scripts/jquery.ui.datepicker-fr.js"></script> <% ScriptManager.RegisterStartupScript(this, this.GetType(), "scripts", "onload();", true); %> <script language="javascript" type="text/javascript"> $(document).ready(function () { onload(); }); function onload() { //alert("MessageBox");
Getting checked value of element class
I have tried both of these, but neither works: var sex = $("input[name=sex]:checked").val(); var sex = $( ".sex option:checked" ).text(); <div style="display:inline;"> <input type="radio" id="male" class="radio sex" value="male" name="elements[]" checked="checked" /> <label for="male">Male</label> </div> <div style="display:inline;"> <input type="radio" id="female" class="radio sex" value="female" name="elements[]" /> <label for="female">Female</label>
Why is the event in my for loop never getting called?
I've got this function, which *is* getting called: function setReportsConfiguredForUnit(unitval) { $.ajax({ type: 'GET', url: '@Url.Action("GetReportsConfiguredForUnit", "ReportsConfigured")', data: { unit: unitval }, cache: false, success: function (returneddata) { for (i = 0; i < returneddata.length; i++) { checkConfiguredReports(returneddata[i]); } },
Call and use php function in jquery
I have the following php function. public function dateIndaysoff($mydate=false){ if(!$mydate)return false; $host = "localhost"; $user = "user"; $pass = "pass"; $databaseName = "database"; $tableName = "table"; $con = mysql_connect($host,$user,$pass); $dbs = mysql_select_db($databaseName, $con); // $db=JFactory::getDbo(); $dbs->setQuery("select date from table WHERE `date`='$mydate'")->query(); return (int) $db->loadResult(); } This function searches an input value inside a database table column and
How to get device information
Hi there, In my app, I'm requesting use access to device information. In my app, I have contact me email link. When clicked, I would like to populate email body with device information such as device id, OS type and version, etc. How do I go about doing this? Joe
Creating a local area to share data.
Hi everybody, I would like to know if is possible to create a local area where same PCs, connected by LAN, can share some software. For example in laboratory where are PCs conneted by LAN, the teacher gives a lecture to students entering a restricted area controlled by the teacher. Thanks in advance Tegatti
How to pass other value in jQuery Autocomplete lists/label that is not selected using the Autocomplete itself
I am doing a email function where there are 2 options for selecting the receivers: (1) Choosing from Autocomplete box (for small number of receivers) (2) Choosing from list of Radio Button (for large number of receivers) I use the Facebook themed Autocomplete. My question is: How do I pass the value that is selected from (2) to be displayed together in the Autocomplete box with the value selected from (1). My code for the Autocomplete is as follow: <input type="hidden" name="receiver" value="<?=$receiver?>">
Validate: limiting number of selections in a multiple select
Hello, I've got Jquery Validate running on my form locally and have all form element validations working correctly except this one. I've been searching the forum but can't come up with a solution. I have a select box set to multiple. The list of options is about 15-20 items but users can only choose 5. How can I check that they have not selected more than 5 and message them if so? <select id="my_list" name="my_list" class="form-control" multiple="multiple"> <option value="1">home</option> <option
Localization of mobile app
Hi there, Localization has nothing to do with jQuery Mobile, but I was wondering if I could get some pointers on localization of mobile app. I have written a mobile app using jQuery Mobile and would like to localize it to French. Joe
jQuery toggling highlight on/off
I am designing a program that adds and removes text highlighting based on the clicking of a button. My program works the first time through, i.e. click once highlighting turns on, click twice highlighting turns off, but after that the clicking does not trigger anything. What am I doing wrong? Sample code can be found here using jQuery 2.2.3: https://jsfiddle.net/deanc1983/fyfusboe/#&togetherjs=mGIo5lAvM9
jQuery function only firing once on button click
I'm having an issue with my function only triggering in one cycle. When I click the Highlight button my text highlights, when I click Un-Highlight the highlighting is removed...however everything stops after this. When I click the Highlight button again nothing happens. <script> // Use Strict indicates that the code should be executed in "strict mode" which does not allow for use of undeclared variables. "use strict"; $(document).ready(function() {
jquery ajax
Hi, a question about $ajax Jquery function. Why if i passed 2 parameters to my php file that do an ordered query (select * from table where field1=param1 or field2=param2 Order by .... ASC) it just reply to me only records following first condition for example? Thx a lot
multipleSelect echo selected values from PHP array
I am developing a patient database management system. I have a page in which you can add a patient to the database, and submit a lot of data related to that patient. So I have a multipleSelect which is dynamically populated (from a jquery array) depending on the option selected in another selection box. This works perfectly and I then post the selected values in the multipleSelect to my database using PHP. The values are stored in the Database in a comma separated array. On a separate page I have
find color of top left pixel image
Is there a way with JQuery to find the first pixel top/left color of an image ? thank you
How to put custom buttons to manage listbox item(Move right/left,..etc) in between left and right ListBox in DualList box?
I'm using Bootstrap Duallistbox - v3.0.5 but I don't have any idea about how to put custom buttons controls in between left and right listbox for managing listitem's movement?
Next Page