[jQuery] Remove an element ONLY if exists
<div dir="ltr">There's a way to remove a element by his id, but first check if it exists? thanks. </div>
how do i append the div (id="this") into table?
<script src="jquery.js"></script> <script> $(document).ready(function() { $("#tbl_add").click(function(){ $("table").append("#thi"); }); }); </script> <table border="1"> <tr> <td>Label</td> <td>Find By</td> <td>Event</td> <td>Data</td> </tr> <div id="this" <tr > <td><input type="text"
i want to append the tr row in the table..the code doesnot works well!
<script> $(document).ready(function() { $("#tbl_add").click(function(){ $("table").append("#thi"); }); }); </script> </head> <body> <div id="Case"> <div id="CaseTable"> <form> <table border="1"> <tr> <td>Label</td> <td>Find By</td> <td>Event</td> <td>Data</td> </tr> <tr id="thi">
Simple toggle question
Using this simple code - <script> $(document).ready(function(){ $(".header").click(function(){ $(".listholder").toggle(); }); }); </script> By default I would like the .listholder div to be minimized and only show when the .header is clicked. At the moment it shows when the page loads. How can I achieve that? Thanks, Mart
Converting .live() to .on() with complex selector
How can this be converted from .live() to .on()? $('[id^=generic1_id_]', '[id^=generic2_id_]').live('click', function(){ To convert to .on(), I could create two working examples seen below, but then I have to re-use code in both, whereas with the .live() example, I am able to reference both selectors and the code will be executed on a click event for either selector. Also, I am using .live() because the click handler needs to apply to new elements added/created after the DOM is loaded. I know the
.addClass not updating page, but does through debugger!
I have this simple section of code: if (field != null) { var data = snapshot[key]; var value = data['name'] ? data['name'] : data; var prevValue = field.val(); field.val(value); if (prevValue != value) { field.addClass('lvd-value-changed'); } else { field.removeClass('lvd-value-changed'); } } I am using a socket technology that sends the data directly to the browser. I get a snapshot of data as JSON. I am able to see the values
Back button Chrome and IE
Hi, why if I press TEST button (TEST button now is disabled) and then press GO button, when I press the back button of chrome or ie TEST button is enabled but was disabled....with firefox works. test page Thanks
if condition not working properly
Hi, I am using below code the data form other page coming properly but while i am showing this in html page, the if condition is not working properly, whatever the result it going only with the if condition not in the else condition. both the time code of if part is working $(document).ready(function() { $.post("check_user.php",{uname:uname}, function(data) { alert(data); if(data=uname) { alert("Already exit pls change!"); $("#user_name").val(''); $("#user_name").focus(); } else { alert(data); }
Hiding an iput field on an option select drop down
Hey Guys. I have wrote a small piece of code that should hide the credit card text field if a user selects cash. I am not sure if my selector statement is incorrect or my .click() function is incorrect since its not an actual click. It a selected option. By the way my jquery code is all the way at the bottom of the after the HTML gets loaded. Below is my code. Any help would be really appreciated! $("option>select(eq(1))").click(function(){ $("#credit_card_number").hide();
Navigation Does Not Display on Mobile Devices
A jQuery navigation I'm using works properly on desktops and laptop devices, but for mobile devices (iPhones, iPads, and Androids) it does not display. Need help identifying a solution. The URL: Foremost Family Health Centers. Thanks in advance for your assistance.
When I fill my page with a div, I can't get the height of the body of the page any more
I have a page which has a button. If the user clicks it, the button fires javascript to expand a DIV to cover the page. This works. However, it gets complicated because the DIV has some contents within it. It has some text. It also has a footer that stays in the same place no matter how much the user scrolls down the text, and that footer is needed because it has a MIMIMIZE button to get rid of the DIV, when the user decides he has read enough. I've made a much simplified page at: https://rateforsuccess.com/showcss.htm
Display trailing zero for price in jquery
Hey all, Hopefully someone can help with this. I am simply looking to add the final zero to the decimal part of a price in a price calculator I am written. The calculator starts with a user selecting a standard "Sign Up" fee of €25.50 and then selecting other packages to increase the price. At the moment, the standard price displays as €25.5. costs = jQuery('.cost-container').text(); total = Number(costs) + (25.50).toFixed(2); I got this code by looking at the following similar query:
HELP ME JSON
Buongiorno sto provando un rializzare Una Pagina Che al Momento del login svi apparire all'utente collegato, DOPO Aver Inserito username e password, svi aprirsi Una page con il riepilogo dei Dati Contenuti in un file JSON Nazioni Unite. non così passeranno la Chiamata al JSON per recuperarne i Dati contenuti. di Seguito scrivo il file di JSON e la page html: UTENTE.JSON: { "Nome": "Pippo", "Nationality": "Baudo", "Dati di Nascita": "1936/07/06", "Provincia di Nascita": "Catania", "Comune di Nascita":
What does this code mean? Why including JS like this??!!!
<script type="text/javascript"> window.jQuery || document.write("<script src='js/jquery-2.0.3.min.js'>"+"<"+"/script>"); </script>Why not just <script src='js/jquery-2.0.3.min.js'></script> Thanks
I need help with product page
Hello you all! I'm a new member I need a jQuery script for product pages, with a big photo that change when you click on one of the thumbnails. Something like you cann see in [b][URL="http://www.bally.com/item/store/BALLY/tskay/1FACB8A1/rr/1/cod10/44628763HJ/areaid//sts/"]this product page[/URL][/b], for example. Currently I'm using a simple code for pages with 2-3 pics, but I'm afraid it won't be useful for 20 pictures. Thanks in advance!
change href
i have some links on my page like http://domain/uploads/docs/1.pdf and i need it to change the links while page is loading to http://domain/DownloadHandler.ashx?path=../uploads/docs/1.pdf look that path could not always be /uploads/docs it may read the "original path " and just add the DownlaodHandler.ashx? etc also i see that my page takes some 2 or 3 seconds to load all scripts or jquery and javascript and it make some contente to move on that 3 second window time so in that time i saw content
Can someone help me with this question?
You are developing a form that captures a user's email address by using HTML5 and jQuery. The form must capture the email address and return it as a query string parameter. The query string parameter must display the @ symbol that is used in the email address. You need to implement this functionality. How should you develop the form? <!DOCTYPE html > <html> <head> <script src=http://code.jquery.com/jquery-latest.js></script> </head> <body> <form> <input type=”text” name=”email” /> <input type=”submit”
Can select an element, please help.
Hi Guys, First of all, I'm sorry, I'm not very familiar with jQuery (only Basics). I'm doing a Price Count for my website and I'm stuck, because I can't select the element I need. Here is JSFiddle The problem is no matter what I'm trying but I can't get the title (or HTML inside the div) to display it in the textarea. I would like to retrieve the text inside the element, so to avoid adding extra tags to html. <div class="medium-6 columns title" title="titulo">Titulo</div> When I create this var product
Append to selector in textarea
Hi, I have a textarea (or div) and I wanna append a text in it which my mouse selector is somewhere. let me clarify it : For example you click in text area to write some thing and when you wanna insert some thing it will insert to near your selector not end of sentence... thank you
Uncaught TypeError: Cannot call method 'createDocumentFragment' of undefined in Chrome
Everything in IE/FireFox is fine but in Chrome appear this.. i don't know what is the real problem.. anyone can help? i am using jQuery JavaScript Library v1.10.1 this problem appear after i execute $('.title_headers').slideDown('fast', function () { $('.toogleHeader').find('a:first').removeClass().addClass('tdown'); }); this simple code..
jQ Custom Theme Problem
I've installed jQuery accordion with a custom theme on a Squarespace site. All looks (correct colors for default, hover and active states, content background, etc.) and works as it should (collapsible, etc.). Only issue is no icons and no gradients. jQ css is looking for images at url(images/filename) but when I upload the image files to Squarespace they are put in a new folder so the url becomes /s/filename. Squarespace has a URL Redirect function so I entered a 301 redirect for each of the 11 files
Issue on Updating a jQuery Function by Ajax and PHP
Can you please help me to figure out how to pass ajax result into a jquery function. I have a HTML Select options as: <?php define('DB_HOSTNAME', 'xxxx'); define('DB_USERNAME', 'xxxx'); define('DB_PASSWORD', 'xxxx'); define('DB_DATABASE', 'xxxx'); $mysqli = new mysqli(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE); if ($mysqli->connect_errno) { die('Unable to connect!');} else{ $query = 'SELECT DISTINCT projectID FROM DATA'; if ($result = $mysqli->query($query))
Call a function each 10 days and an other each 30 days
Hi, how to call a function each 10 days ? and an other one each 30 days ? function run_each_10_days() { alert("10 days was left since last call!"); } function run_each_30_days() { alert("30 days was left since last call!"); } The two function should remain showing the alert for all the 24 hours of that day, when if complete 10 days for the first case, and when it complete 30 days for the second. Thank you.
AJAX - And using .data()
Brief description of what I'm attempting to do: I'm developing a small web application where I'm posting comments with AJAX. So I'm using the $.post method and jQuery templates to do that. All is fine there. However, I'm also attempting to make a like button where the user should be able to like each post. So my first problem is that I need to store the comment ID in the like link somehow (I think), please correct me if I'm wrong. So the best way I could conceive of to do that was to use the .data()
one site - three great jquery effects
evening all :-) ...so... i have had an idea in my head that i have been looking around for the best way to translate the grey cells into actual pixels... never an easy task... then - i stumbled across this site/microsite... which pretty much does the things that i want... can anyone help me out here - i guess that although it not being a case of re-inventing the wheel it is a tricky one to get all three bundled up together. does anyone know how to - or any tutorials/examples/github/other resources
Jumping Up To The Page
hello guys I have a problem with a jquery i think let me explain ... i was working on a blog wordpress and ... when you click on the links a href links it jumps to the top of the page and then you have to scroll down and see whats going on i have popup block that it jumping up and you have to scroll down i have drop down jquery menus Could some one tell me where is the problem wich .js file is making problem and how can i make this fix the website link
add more rows to jquery cookies or appending to query cookie
I am using following code to check cookie availability and create a new cookie. If cookie exists then I need to one more row to the existing cookie. function addUsers(userID, userName) { var userInfo = []; userInfo[0] = userID; userInfo[1] = userName; var cookieName = 'cUserInfo'; if ($.cookie(cookieName)) { //need to add another row to the existing cookie } else { $.cookie(cookieName, escape(userInfo .join(',')), { expires: 1 }); } } Please advise how to read all set of cookies as well.
tooltip background color change
Just to start, I'm a graphic designer that was asked to take on a special project because of my familiarity with HTML and CSS. I am by no means an expert with js or jquery. I was asked to create special tooltips for various elements on a web page. My only issue is I found some pre designed code that I liked here, https://jqueryui.com/tooltip/ and now I cannot figure out how to change the color of the background on the tooltips I attached to my page. Please someone help me before I lose it.
Uncaught TypeError: Object [object Object] has no method 'slider'
Hi, I trying to use jquery slider to chose range of port numbers, I did this : <label class="formLabel">Port</label> <div id="slider-range"></div> <input type="text" id="minvalue" property="criteriaPort" name="minvalue" /><br> <input type="text" id="maxvalue" property="valuePort" name="maxvalue" /><br> ............. </html:form> </div> <script type="text/javascript" src="js/enhance.js"></script> <script type="text/javascript"> enhance({ loadScripts:
Disable input button in table row if that row contains specific value
I want to make program of JQUERY table which disables button in table row..if that rows contains specific value=2.
Is the new version of JQUERY compatible with parallax and waypoint?
Hi I am creating an effect based on this demo: http://cdn.tutsplus.com/webdesign/uploads/legacy/tuts/338_parallax/src/index.html So I need to use the following plugins: jquery.stellar.min.js waypoints.min.js jquery.easing.1.3.js But I also need to use the latest jquery library: http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js However it does not work with the most recent JQUERY plugin. The original demo uses: ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js I have tried other
Cell Element gets clear in Jqgrid
Hi, I m using JqGrid. I have created an application where I used to copy grid elements from one page to other. The Other Page have Tabs Structure, Whenever I click on One tab call "Budget Codes", it clears one column of first row. I really don't understand the problem. Please help me in this. Below is the snapshot for same: And here is my code: function LoadBudggrd(Bindjson) { var LoadGrd = (CurGrd == 4); if (LoadGrd || BudGrdNotLoaded) { budggrd.setGridWidth(1500, true);
How do I validate an array of form elements, for a valid date value
I want to prevent the form from submitting if there is an invalid date value I have an array of date inputs with random values.... Not every field has to have a value, but if it does-it has to be a valid date... <input name="job_date_completed[521]" type="text" value="10/10/2012" > <input name="job_date_completed[528]" type="text" value="10/10/2012" id="date521" enabled="" > I already have this function: function ValidateDate(dtValue) { var dtRegex = new RegExp(/\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/);
Error in taking cell value using jquery
Hi all, I want to add a class name to a gridview cell take the value from the cell; following is my code $("#GridView1 tr td").filter(":not(td:first-child)").each(function () { var colindex = $(this).closest("tr td").prevAll("tr td").length; var headertext = $("table[id*=GridView1] th").eq(colindex).text(); var cellText = $(this).text(); if ($.trim(cellText) == '') { $(this).css('background-color',
How to add music plugin add using J Query?
How to add music plugin add using J Query? Can you give me solution
Jquery form validation for radio button
Hi, I am confident that I am in the right forum for my question to be resolved. Thanks in advance. I have a form in which there are five input fields with radio buttons ("YES" and "NO" options). To submit the form the user has to select all the five radio button, with "YES" or "NO" options, If the user does not select any of the options and continues to click on continue button, it should throw an error message. like wise If the user selects two of the options and does not select rest of them and
Using jquery with nvd3
Hi, I'm using nvd3 library to create charts for a dashboard and i don't know how many charts will be inserted in my html file, so i've created a function that based on the info that the server returns i generate the chart code and add it to my file. My problem is that nvd3 uses d3.js for the charts and it uses svg to display them. What i want to do is just show the chart (line, bar, pie, etc). How can i do it using both librarys? Thk
Changing text color with CSS
Hey Guys. I am trying to change the color of an astrix to red using jQuery. For I can't seem to get it to work. Can anyone please help? I would really appreciate it. Below is my jquery code and my HTML code. I just posted one of 20 of my td's (Please note I am also new to jquery) $("table").find(HTML("*")).css(color:"red") <table> <form action=“#” method="POST" > <tr class="title"> <td> *Please Enter your full name</td></tr> <tr> <td><input type="text" name="name" id="name"
what is the meaning of following code ?
can any one explain me meaning of this code please.......... protected void btnSubmit_Click(object sender, EventArgs e) { string strSelectedItems = string.Empty; foreach (var ctrl in Panel1.Controls) { if (ctrl is CheckBox) { CheckBox chk = (CheckBox)ctrl; if (chk.Checked == true) { strSelectedItems += chk.Text + ","; } } } strSelectedItems
Toggle and show hide menus in responsive design
Hello, I have a responsive webpage (template) needs to have three sections (search bar, main menu and sub menu) become toggle menus when page re-size smaller than 768px (or the devise screen size is smaller than 768px). Similar to this page: I inserted the following code in the bottom of the page - it works but is there a better way or best practice to organize such functions? Many thanks! <script> $(function() { //search bar show hide $(".searchIcon").on("click touchstart", function(e){ e.stopPropagation();
Next Page