How to Use in jQuery the PHP session variable set by Ajax.
As for two general PHP files, no big deal to use the session variable if 'session_start()' is declared at the top. session_start(); $_SESSION['name']; --------------------------------------- But in jQuery, how should I use the session in index.php? The var name doesn't work at the end of codes. [index.php]------------------------------------------------------------------------------------- <?php session_start(); } ?> <!DOCTYPE html> <html> <head> bla bla <script type="text/javascript">
How can I append html to an ID'd element (why isn't .append() working)?
I want to append some html to an element; so far my failure is so catastrophic as to make Napoleon's battle at Waterloo seem like a roaring success by comparison. Before adding it to actual code, I tried fiddling around first with these variations on the theme, based on what I got from here, but it's not working. What am I missing/doing wrong? The HTML from the fiddle is: <h2>REPORTS TO BE GENERATED</h2> <table style=\ "width:100%\"> <tr> <th>Report Name</th> <th>Unit</th> <th>Generation
How can I get a jQuery alert to display html?
I'm passing html from my server Controller method back to the Ajax call, but it's not displaying as html. This is the client code: $("#btnViewList").click(function () { $.ajax({ type: "GET", url: '@Url.Action("GeneratePDFOfReportFutures", "GenerateScheduledRptsPDF")', success: function (retval) { alert('pre-success from btnViewList');
Using getDynamicElement with <Br/>
I've gotten this line of code to work, but when I add a <Br/> to format my field below it doesn't work. My Field: changeElementDescription("Have you been accepted in<Br/> your program of choice?", "You must be accepted into the college program of choice in order to apply for academic sponsorship.", "acceptanceProgram"); $(getDynamicElement(Have you been accepted in your program of choice?')).change(function(){ var currentSelection = $(getDynamicElement('Have you been accepted on your program of
Jquery Disabled Dates next working days not showing
Hi, I am using the below code for displaying datepicker with disabling friday, Saturday and max date: 2 days, but it should show next 2 working days after disabling days. Code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Restrict date range</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>
Font-family in css doesn't work
I want to apply Arial to #about, #home, #support. But they never change. PLEASE see the attached in: https://jsfiddle.net/jsfiddle135/n8L6m5gt/3/
Applying the same function to two elements
Hi, How can I apply the same jQuery function to two different elements. I tried this, but it doesn't work: slideFade($('.messages.status'), $('messages.error')); Why it's not working? I know that it works this way: slideFade($('.messages.status')); slideFade($('.messages.error')); But is this the right way to do it? Thanks
for () issue
Hi, I'm currently working on a project that a script already exist but needs tweaking. Basically what it does is it performs a Get request from a service provider for job posting and display all new posts to the website. But the issue is, if the user only has 1 post we get an error "data[i] is undefined". if (data.length > 0) { for (var i = 0; i < 5; i++) { tableList += "<ul class='sidebar-latest'><li><h4 class='post-title'><a
Random image with timed refresh
I'm needing to pull a random image from over 200 images so loading them all up front is not possible as the load time would be much too long. So I need something that will pull one randomly and then after a few seconds run again to load another image. The JPG images are named 1.jpg, 2.jpg, 3.jpg, etc. The plain javascript I have now requires that the whole page reloads to get the image to change. Below is the code I'm currently using: <div id="header_image"> <script language="JavaScript" type="text/JavaScript">
How can I add navigation to my jquery slideshow?
I have a site on blogger and I used jquery slide in this page http://www.aniavouloudi.com/p/anagnorisis.html How can I make it slide only with navigation buttons and how do I add them? In HTML above </head> I put this: <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js' type='text/javascript'/> <script type='text/javascript'>//<![CDATA[ $(function(){ $('#slider div:gt(0)').hide(); setInterval(function(){ $('#slider div:first-child').fadeOut(0) .next('div').fadeIn(0000)
Checkin input text value in table.
Hi, I would like to check the value of my input text in a table when I input it. All these input text have an id that starts with the same letter (q) I've tryed in this way: $('input[id^=q]').keyup(function() { }) Thanks in advance Tegatti
Michael Schoenly - Is Java script different from jQuery?
Hello, I am Michael Schoenly. I work in html and i want to improve my skills and planing to learn jQuery. But i am little confused whether jQuery an javascript is same or not.
How does this dialog invoking code work
I am new to jquery and do not understand exactly what is happening. I am opening a dialog using the ajax API. I understand how this selector is suppposed to work - $('#'+divId). The element being selected by '#'+divId is actually a div where I want the dialog to be opened. What I do not understand is what the .html(data) does before the .dialog(). The data is being returned from the successful ajax API. The value of data appears to be "longString". I determined this using firebug. When I
FadeOut and Remove after 2 seconds
Hi, As the title is saying I'm trying to achieve that a div fadesout and get removed completely after 2 seconds. To do this I wrote following code: FadeOut and get removed after 2 seconds But it's not working. Could you please help me to find out why it's not working? Thanks
Merge jQuery table paging and filter functions so they work together
I have a webpage with two tables https://jsfiddle.net/51Le6o06/37/ in this jsfiddle everything is working fine. The tables are sorted on page load by (.amount) [to display in order of price] also the filter "free handsets" is working well, as you can see each row has a child row. You will also notice the dropdown box above each table which I will get to shortly. jQuery used: jQuery.fn.sortPaging = function(options) { var defaults = { pageRows: 2 }; var settings = $.extend(true, defaults, options);
I need help to add cycle slide show iffect
I follow this link: http://jquery.malsup.com/cycle/begin.html and my code is <%@ Page Title="" Language="C#" MasterPageFile="~/Master Pages/General.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Webpages_Default" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <script type="text/javascript" src="Scripts/slideshow.js" ></script> <script type="text/javascript" src="Scripts/jquery.cycle.all.js"></script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="mainContent"
Having Trouble finding and replacing a value of a URL
I have multiple links on a page and i would like to change part of the url from file:// to http:// Having trouble doing so. Here is an example of the value of the link <h3 class="ms-srch-ellipsis"> <a clicktype="Result" id="ctl00_ctl52_g_b4789284_23fc_414a_bc11_762caff8cbe3_csr5_item_itemTitleLink" href="file://dev-server.gb.com/docs/project1.ppt" class="ms-srch-item-link" title="R&D Planning Cycle" onfocus="EnsureScriptParams('SearchUI.js', 'HP.Show', 'ctl00_ctl52_g_b4789284_23fc_414a_bc11_762caff8cbe3_csr5_item',
jQuery Pep through NuGet
Hello, Does there happen to be a NuGet package for Pep, probably more recent version, too. Bare minimum, does anyone happen to know the "official" Github, or is there a Github? Thanks!
How To Make Two <divs> collide (not go past each other) When One <div> Is Controlled By You
Click Here --> https://jsfiddle.net/AlexHepworth720/x7msxm5t/ <-- To View My Code!' Use SWAD to move the ball, and Arrow Keys to navigate the page! (click on the page to be able to control the ball) S - Down W - Up A - Left D - Right How do I make the Red Ball (the one you control) collide/not move past the walls/<divs> (the green boxes)? I don't want any special effect, I just don't want the Ball to be able to move past them. How do I do this? Please make it correspond with my code. I would also
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
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
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);
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.
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 -=====================================================
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
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
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() {
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 can I check a value for null in jquery without getting an error?
I've got this code: if (returneddata.daterangeparams.TimeUnitsFrom != null) { ...which throws this error (as seen in the Chrome Dev Tools console) when the value is, indeed, null: Index:1031 Uncaught TypeError: Cannot read property 'TimeUnitsFrom' of null So how can I check for null in a way that I can avoid the error? Based on a suggestion here, I even tried this: if (returneddata.daterangeparams.TimeUnitsFrom != null && variable !== undefined) { ...but I still get the same whinging from the guts
on click function on a special webpage
hi, everyone. I am new in this. I have a doubt regarding anchors and onlick functions. This is the webpage I am working with: http://www.ccttxx.net/testara-ubp/ The images are between <a></a> to active the flipping function when scrolling (I may think that from what I have seen on the code) But now, I need to link each of the years on the bottom menu to the images and I cant do it with a simple anchor. <nav class="menu"> <div class="icon-list"> <a href="#uno"><span>1992</span></a> <a href="#dos"><span>1993</span></a>
closest returns undefined
<input type="text" name="statuteCode" value="" id="txt_search_statuteCode" maxlength="40" size="14" /> <input type='button' id='btnSearchCode' value='' class='button-search' /> var ele = $(this).closest("input[type='text']").prop('id'); // returns undefined, I would expect it to return txt_search_statuteCode while inside the event handler for btnSearchCode Does anyone know what the problem is here? It does find an object, but I don't know what object I fixed it like this: $(this).siblings('input:first').prop('id');
How to avoid auto selection in datepicker
I implement functionality with datepicker and dialog you can click datepicker's title then dialog title. As a result you can go any month or year with few clicks. But when i select month it will show the current date in input box. I want to avoid that. Any suggestion here? Thanks, regards http://jsfiddle.net/x1j739pt/19/
Next Page