- Screen name: Majid Lotfi
Majid Lotfi's Profile
40 Posts
169 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- Hi,I am trying to popup an alert once a day, but it does not work, long time I did not touch jquery, I feel I am lost, thanks, your help is appreciated.Here is what I did :
- <html>
- <head>
- <link rel="stylesheet" href="reveal.css">
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
- <script type="text/javascript" src="jquery.reveal.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- if ( localStorage.getItem('seen') != (new Date()).getDate()) {
- setTimeout(showpanel, 4000);
- }
- $("div").click(function() {
- alert("Wel-Come to the Learn jQuery..!");
- });
- function showpanel() {
- $('.reveal-modal').reveal({
- animation: 'fade',
- animationspeed: 800
- });
- localStorage.setItem('seen', (new Date()).getDate());
- }
- });
- </script>
- </head>
- <body>
- <div id="ex1">
- Click here to open Dialogue Box.
- </div>
- <div id="myModal" class="reveal-modal">
- <h1>Reveal Modal Goodness</h1>
- <p>This is a default modal in all its glory, but any of the styles here can easily be changed in the CSS.</p>
- <a class="close-reveal-modal">×</a>
- </div>
- </body>
- </html>
- Thanks,
- Hi,I have a python program that send from server side random numbers to be displayed in an html page :
-
$(document).ready(function(){
//connect to the socket server.
var socket = io.connect('http://' + document.domain + ':' + location.port + '/test');
var numbers_received = [];
//receive details from server
socket.on('newnumber', function(msg) {
console.log("Received number" + msg.number);
//maintain a list of ten numbers
if (numbers_received.length >= 10){
numbers_received.shift()
}
numbers_received.push(msg.number);
numbers_string = '';
for (var i = 0; i < numbers_received.length; i++){
numbers_string = numbers_string + '<p>' + numbers_received[i].toString() + '</p>';
}
$('#log').html(numbers_string);
});
});
I would like instead of displaying these numbers in the the page show then in :D3 Liquid Fill Gauge
how can I integrate this example with this code :instead of the onclick I want data to change authomatically, no clicking.Thanks, your help is appreciated.- 05-May-2015 01:33 PM
- Forum: Using jQuery
Hi,I found this :I like the swipe pagination of the three images, tried to do the same in jsfiddle :but does not work for me.Thanks.- Hi,I saw this web site, was trying to see what plugin they are using to change the background pictures, is there any easy way how to find a plugin from a web site ?the web site is :using inspector I can see :
- HI,I have this dialog :
- dialog = $("#dialog-form").dialog({
- autoOpen: false,
- height: 500,
- width: 720,
- modal: true,
- buttons: {
- "Create Rename Rule Type ": addUser,
- Cancel: function() {
- dialog.dialog( "close" );
- }
- },
- close: function() {
- form[ 0 ].reset();
- allFields.removeClass("ui-state-error");
- }
- });
It's working fine in Chrome, but not in Firefox.thanks.- 27-Mar-2015 03:40 PM
- Forum: Using jQuery
HI,I look everywhere to understand what is promise and deferred, what we need it for, but all blogs, articles, tutorials are very complicated, I will appreciated if someone give us an easy example for dummies.a working example in jsfiddle , codepen or any.Thanks- $(document).on('click','#metadataListTable .delete', function () { /
- var ans = confirm("Do you want to delete Metadata?");
- if(ans==true){
- var nRow = $(this).parents('tr')[0];
- var data = oTable.row( $(this).parents('tr') ).data();
- alert( data[10] +" ========= "+ data[11] );
- oTable.row( $(this).parents('tr')).remove().draw();
- $.ajax({
- url: "deleteMetadata.do",
- data: "id=" + nRow.id + "&flag=" + "T" + "&ifData=" + data[10] + "&env=" + data[11],
- success: function(response) {
- // alert(response.message);
- toastr.success(response.message);
- }
- })
- }
- });
my problem is in the ajax , for example :the two hidden columns :-
<td class="idata"><Interface environment="QA" from="rm" name="8zxjckeq" to="rm" version="4.0">\r<HTTPS/>\r</Interface></td> <tdclass="edata">QA</td>
data[10] =" <Interface environment="QA" from="rm" name="8zxjckeq" to="rm" version="4.0">\r<HTTPS/>\r</Interface> "and data[11] ="QA"when I go to the server side to read the value of ifData :- String ifaceData = request.getParameter("ifData");
It is always empty.- Hi,I wrote this code :it's working fine, the console display what is expected.but when I run it in my machine (not in jsfiddle) I got null for both of them.here is the markup of my page :Thanks.
- Hi,I have a dialog box that is working fine, the end user has to check one or more checkboxes before pressing the button "Assign", I want to have a validation before submitting, if no checkbox were checked it should diaply an error validation, here is my code :I would like to check if the array agenciesId is empty, display an error and don't submit.
- $("#divPopUp").dialog({
- resizable: true,
- autoOpen: false,
- height: 500,
- width: 550,
- modal: true,
- buttons: {
- "Assign": function () {
- var agenciesId = $(this).find(":checkbox:checked").map(function () {
- return this.value;
- }).get();
- //alert("agenciesId :" + agenciesId);
- var ruleIDd = $("#divPopUp").data('param_1');
- $.ajax({
- url: 'assignRenameRuleToAgency.do',
- data: {"agenciesId": agenciesId,"ruleId":ruleIDd },
- success: function(response) {
- toastr.success(response.message);
- oTable.draw(false);
- //oTable.fnStandingRedraw();
- }
- });
- $(this).dialog("close");
- },
- Cancel: function () {
- $(this).dialog("close");
- }
- },
- close: function () {
- $(this).find(":checkbox").removeAttr('checked');
- $(this).dialog("close");
- }
- });
Thanks.- Hi,I found this code :, I did not understand this line :
- (text.indexOf(valThis) == 0) ? $(this).parent().show() : $(this).parent().hide();
Thanks, your help is appreciated.- I am trying to filter an array by checkboxed, but the console.log did not display anything.
- I always use chrome, used switchButton in my code working fine, byt was surprised when I load the page in ie 11, it did not show the nice switch Button with ON and OFF, it just show a classic checked checkbox, here is a pic of the inspector in ie and chrome :
- 17-Feb-2015 04:09 PM
- Forum: Using jQuery
Hi,the value global (true or false) was constructed from a json, I don't know how to set the valye of each switchButton in a td, here is the fiddle :Thanks.- I used lot of data attributes in my html code, but when deployed I was surprised Apache is not supporting data attributes, so I am trying to convert data attributes that have array as value to hidden text field.here is a fiddle that show the html code :Can you please show me how to read the value of those hidden fileds in jquery ?thanks
- Hi,it looks like our Apache server is not configured to work with html5, I talk to people in charge of the configuration but did not get any help, maybe they don't know how to do that setup.My question here is :when my html page load, couple data attributes got populated from the server side, but let say we have a static html code that has :
-
<tr id="24" data-one="[string1,string2,..stringn]" data-two="[otherstring1,otherstring7,...,otherstringm]" ></tr>
what can you advise me to use instead of data-attributes ?thanks lot.- Hi,I found this copy to clipboard in this page :under the section that says :
Web Server Support for MIME Type
I tried to duplicate it i a jsfiddle, but it does not work, here is my fiddle :Thanks- Hi,I have already asked a question that my code is working locally in my machine, but when checked in, all the data attributes disappear, I started duplicating my code in a jsfiddle :I don't know why I got :nullnullThanks, your help is appreciated.
- 30-Jan-2015 11:08 AM
- Forum: Using jQuery
I am developing locally in my windows using Netbeans IDE and tomcat, data attributes work fine in my local tomcat, but when I checked in my code in the Apache server, and took a look in source code, I found out that all data attributes are stripped from the code :
when I run my code locally (tomcat) : http://jsfiddle.net/mlotfi/b2y9Ls5o/
when I run it in Apache : http://jsfiddle.net/mlotfi/az68hkb0/
Thanks, your help is appreciated.
- Hi,I found this multiselect here :I was trying to use it in a fiddle :could you please tell me what I am missing here ?thanks lot.
- 21-Jan-2015 08:44 PM
- Forum: Using jQuery
am trying to read a data attribute from switchButton event, but I got this error :Uncaught SyntaxError: Unexpected token varHere is the fiddle :Thanks.- 05-Jan-2015 12:05 PM
- Forum: Using jQuery
Hi, I have a datatable, the first column show agencies assigned to this row, in another column I have a button that when clicked show a form to assign new agencies to this row, everything work well, but for the new agencies added I have to refresh the page to see them, is there any way to add them as soon as I click the button "Assign" ?
here is an image showing what I am talking about :
http://s18.postimg.org/9xtvp7w6x/rr_Agency.png
Thanks.
- $("#divPopUp").dialog({
- resizable: true,
- autoOpen: false,
- height: 500,
- width: 550,
- modal: true,
- buttons: {
- "Assign": function () {
- var agenciesId = $(this).find(":checkbox:checked").map(function () {
- return this.value;
- }).get();
- //alert("agenciesId :" + agenciesId);
- var ruleIDd = $("#divPopUp").data('param_1');
- $.ajax({
- url: 'assignRenameRuleToAgency.do',
- data: {"agenciesId": agenciesId,"ruleId":ruleIDd },
- success: function(response) {
- toastr.success(response.message);
- }
- }) ;
- oTable.draw();
- $(this).dialog("close");
- },
- Cancel: function () {
- $(this).dialog("close");
- }
- },
- close: function () {
- $(this).find(":checkbox").removeAttr('checked');
- $(this).dialog("close");
- }
- });
- Hi,I am using a jquery dialog, that is supposed to be hided until the open even, but noticed when the first time the page load I can see the dialog appears and hides quickly , is there any thing to fix this ?thanks.
- Hi,I have a form :
-
<div> <form name="CreateIfaceEnvForm" id="CreateIcaceEnvForm" method="post" action="/Grouping/createIfaceEnv.do"> <label for="disabled" class="formLabel">Disabled*</label> <select name="disabled" tabindex="1" id="disabled" class="criteria" title="Disabled"> <option value="F">Enabled</option> <option value="T">Disabled</option> </select> <br/> <br/> <label for="interfaceType" class="formLabel">environment*</label> <input type="text" name="interfaceEnvironment" size="10" tabindex="2" value="" id="interfaceEnvironment"> <div> <span class="status"> </span> </div> <br/> <input id="createenv" type="submit" name="submit" class="submitbutton" tabindex="3" value='Create Environment' /> <a href="/Grouping/listSAIAdmins.do?id=saiAdmins" tabindex="4" class="linkButton">Back To SAI ADMIN</a> </form> </div>
and my js code :- $("#interfaceEnvironment").focusout(function () {
- console.log("inside blur");
- var env = $(this).val();
- $(".status").html("<img src='images/loading83.gif'><font color=gray> Checking availability...</font>");
- $.ajax({
- url: "isMetadataEnvAvailable.do",
- data: "envname=" + env ,
- success: function(response) {
- if(response.message === "exist"){
- $(".status").html("<font color=red face='arial, sans-serif' size='2px'> This environment already " + response.message + "</font>");
- $("#createenv").attr("disabled", "disabled");
- }
- else{
- $(".status").html(response.message);
- $("#createenv").removeAttr("disabled");
- }
- }
- })
- });
The check availability is working, but the end user got confused with this design, any thought or correction will be appreciated.Thanks- Hi,Can you please tell me how to get the value of dynamically added fields, for example this jsfiddle :Thanks
- Hi, I would like to have the difference between two arraysfor example :A = ['a','b','c']B =['b'] <--- B is always included in Amy result C == A - B == ['a','c']Here is my jsfiddle :I would like an array that has this difference :data-restagencies - data-agencieswhen this button is clicked :
- $('button.btn').on('click', function () {
Thanks- «Prev
- Next »
-
Moderate user : Majid Lotfi
-
© 2013 jQuery Foundation
Sponsored by
and others.
-