Search Results

Search found 362 results on 15 pages for 'ankur sharma'.

Page 13/15 | < Previous Page | 9 10 11 12 13 14 15  | Next Page >

  • jQuery - get a list of values of an attribute from elements of a class

    - by Ankur
    I have a class called object which has an element called 'level'. I want to get a list of all the different values of level on the page so I can select the highest one. If I do something like: $(".object").attr("level") will that get me a list of values that are the values of the level attribute? I suspect not, but then how do you do something like that. Note: I don't want to select an HTML object for manipulation as is more common, rather I want to select values of the attribute.

    Read the article

  • How can we make a single dimension array to multidimensional Hierarchical ?

    - by Chetan sharma
    I have an single array of Hierarchical categories. Index of the array is the category_id like:: [8846] => Array ( [category_id] => 8846 [title] => Tsting two [description] => Tsting two [subtype] => categories [type] => object [level] => 2 [parent_category] => 8841 [tags] => new [name] => Tsting two ) each value has its parent_category value, I have around 500 elements in the array, what is the best way to make it. Process i followed: krsort categories array, so that all the child categories are at the beginning, then function makeHierarchical() { foreach($this->categories as $guid => $category) { if($category['level'] != 1) $this->multilevel_categories[$category['parent_category']][$guid] = $category; } } but this is not working, it does it only for first level. Can someone point out me the error.

    Read the article

  • Javascript - cannot make static reference to non-static function ....

    - by Ankur
    I am making a reference to the Javascript function splice() on an array and I get the error: "Cannot make a static reference to the non-static function splice()" What's going on - how is this a static reference, aren't I referencing an instance of an Array class and its method - how is that static? $(document).ready( function() { var queryPreds = new Array(); var queryObjs = new Array(); function remFromQuery(predicate) { for(var i=0; i<arrayName.length;i++ ) { if(queryPreds[i]==predicate) queryPreds.splice(i,1); queryObjs.splice(i,1); } } }

    Read the article

  • Accessing the calling object into ajax response... (not the ajax call)

    - by Nishchay Sharma
    I have an object of type Application (defined by me). Whenever an object of this type is created, it automatically loads a php file say "start.php" using jquery ajax and assign the response to a div say "Respo". Now what i want is to access the Application object from that Respo div. Unfortunately, i have no clue how to do this... in my ajax call: function Application(options) { ....... var appObj=this; $.ajax({ url:appObj.location, //Already defined success:function(data) { $("#respo").html(data); } }); } Now in my Respo division i want to access that Application object... I tried: alert(this) but it resulted in an object of DOMWindow... i tried editing success function as: function Application(options) { ....... var appObj=this; $.ajax({ url:appObj.location, //Already defined success:function(data) { $("#respo").html("<script type='text/javascript'>var Self="+appObj+"</script>"); $("#respo").html(data); } }); } But i ended nowhere. :( Although if i assign "var Self='nishchay';" then alerting Self from start.php gives nishchay but i am not able to assign the calling object of Application type to the Self variable. It is the only way I cud think of. :\ Please help me... actually my object has some editing functions to control itself - its look and feel and some other options. I want the code loaded by object to control the object itself. Please help me.. Thanks in advance. Nishchay

    Read the article

  • An html input box isn't being displayed, Firebug says it has style="display: none" but I haven't don

    - by Ankur
    I have placed a form on a page which looks like this: <form id="editClassList" name="editClassList" method="get" action="EditClassList"> <label> <input name="class-to-add" id="class-to-add" size="42" type="text"> </label> <label> <input name="save-class-btn" id="save-class-btn" value="Save Class(es)" type="submit"> </label> </form> But when it get's rendered by a browser it comes out like this: <form id="editClassList" name="editClassList" method="get" action="EditClassList"> <label> <input style="display: none;" name="class-to-add" id="class-to-add" size="42" type="text"> </label> <label> <input name="save-class-btn" id="save-class-btn" value="Save Class(es)" type="submit"> </label> </form> For some reason style="display: none;" is being added, and I cann't understand why. This results in the text box not displaying.

    Read the article

  • How to get status code(409 for conflict) and message("your code is conflict") through falut event in

    - by Ankur
    I am calling a server method through HTTPService from client side and in response i am sending sending status code(409 for conflict) and message("your code is conflicted") from serverside on error but on client side in fault event i am getting status code 0 and message = "faultCode:Server.Error.Request faultString:'HTTP request error' faultDetail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL:" I want to know how to get the actual status code and message in fault event.

    Read the article

  • What jQuery is triggered when a user selects a "drop down list" option

    - by Ankur
    I want to display a different form for different selections of this drop down list: <label> <select name="type" id="type"> <option value="object" selected="selected">Object</option> <option value="number">Number</option> <option value="text">Text</option> <option value="date">Date</option> <option value="time">Time</option> <option value="geo">Geospatial</option> <option value="currency">Currency</option> </select> </label> What would be the jQuery event that is triggered when a user selects one of these options. Would the .click() event be triggered in this case as well?

    Read the article

  • How does file creation work in Java

    - by Ankur
    I am trying to create a file using File newFile = new File("myFile"); However no file called "myFile" is created. This is within a Web application Project i.e. proper form to be pakaged as a WAR but I am calling it as part of a main method (just to see how this works). How can I make it so that a new file is created at a location relative to the current one i.e not have to put in an absolute path.

    Read the article

  • MySQL error code:1329 in function

    - by Sharad Sharma
    DELIMITER // CREATE DEFINER=`root`@`localhost` FUNCTION `formatMovieNames`(lID int) RETURNS varchar(1000) CHARSET latin1 BEGIN DECLARE output varchar(1000); DECLARE done INT DEFAULT 0; declare a varchar(200); declare cur1 cursor for select fileName from swlp4_movie where movieID in (select movieID from lesson_movie_map where lessonID = lID order by lm_map_id); DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1; open cur1; read_loop: loop fetch cur1 into a; if done = 1 then leave read_loop; end if; set output = concat(output, 'movie:[',a,']<br/>'); set output = substr(output, 0, length(@output)-5); end loop; close cur1; RETURN output; END// I have create this function and when I run it I do not get any output (select fileName from swlp4_movie where movieID in (select movieID from lesson_movie_map where lessonID = 24 order by lm_map_id)); brings correct result I am trying to get result as movie:['movieName']< br / movie:['movieName1'] and so on (had to change br tag, cause it was adding a line break) cant't figure out what I am doing wrong

    Read the article

  • Ways to avoid Memory Leaks in C/C++

    - by Ankur
    What are some tips I can use to avoid memory leaks in my applications? In my current project I use a tool "INSURE++" which finds the memory leak and generate the report. Apart from the tool is there any method to identify memory leaks and overcome it.

    Read the article

  • How do I pass an ArrayList to method that takes a collection as an input

    - by Ankur
    I want to pass some ArrayList X into method a(Collection someCol) that takes Collection as an input. How can I do this? I thought an ArrayList was a Collection and thus I should be able to "just do it" but it seems that Collection is an interface and ArrayList implements this interface. Is there something I can do to make this work ... if you understand the theory that would also help me and possibly lots of other people. Thanks

    Read the article

  • Find all numbers that appear in each of a set of lists

    - by Ankur
    I have several ArrayLists of Integer objects, stored in a HashMap. I want to get a list (ArrayList) of all the numbers (Integer objects) that appear in each list. My thinking so far is: Iterate through each ArrayList and put all the values into a HashSet This will give us a "listing" of all the values in the lists, but only once Iterate through the HashSet 2.1 With each iteration perform ArrayList.contains() 2.2 If none of the ArrayLists return false for the operation add the number to a "master list" which contains all the final values. If you can come up with something faster or more efficient, funny thing is as I wrote this I came up with a reasonably good solution. But I'll still post it just in case it is useful for someone else. But of course if you have a better way please do let me know.

    Read the article

  • Writing to a file in a servlet

    - by ankur verma
    I am working in a servlet and has this code : public void doPost(blah blah){ response.setContentType("text/html"); String datasent = request.getParameter("dataSent"); System.out.println(datasent); try{ FileWriter writer = new FileWriter("C:/xyz.txt"); writer.write("hello"); System.out.println("I wrote"); }catch(Exception ex){ ex.printStackTrace(); } response.getWriter().write("I am from server"); } But everytime it is throwing an error saying Access Denied.. Even when there is no lock on that file and there is no file whose name is C:/xyz.txt what should I do? ;( java.io.FileNotFoundException: C:\xyz.txt (Access is denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:212) at java.io.FileOutputStream.<init>(FileOutputStream.java:104) at java.io.FileWriter.<init>(FileWriter.java:63) at test.TestServlet.doPost(TestServlet.java:49) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722)

    Read the article

  • C++ Structure v/s Class

    - by Ankur
    Hi, Please let me know whats the difference between a C++ structure and a C++ class apart from access specifier. I have seen inheritence , polymorphism in C++ structure?

    Read the article

  • How to detect if a form input element of type file is empty

    - by Ankur
    I have some code which reads a file through a form field of type file <input type="file" ... /> I want to give the user another option of providing a url to a file rather than having to upload it as many are already online. How can I detect when this field is empty on the server side. I am using Apache Commons FileUpload FileItemStream item = iter.next(); name = item.getFieldName(); stream = item.openStream(); if(!item.isFormField()){ if(item.toString()!=""){ .... I need to detect when item is empty. The above code doesn't work, nor does using: if(item.equals(null)){ ....

    Read the article

  • Detecting operating system or computer name through a Java servlet

    - by Ankur
    I have a Java web app that I develop on a Windows machine and will deploy on a Unix machine. There are some file path settings and permissions details that differ on the two (and there is nothing I can do to change this). Is there some way of detecting which machine the app is sitting on (it's only one of two), either by detecting the operating system or the computer's name so I can then using the appropriate settings.

    Read the article

< Previous Page | 9 10 11 12 13 14 15  | Next Page >