Search Results

Search found 37568 results on 1503 pages for 'iif function'.

Page 111/1503 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • Anonymous functions IE issue/problem in Javascript

    - by Bragaadeesh
    Hi guys, I am having a javascript written like this. imageDiv.onclick = function(){xyz.deleteImage(param1, param2);return false;}; Now things are fine in Firefox, Chrome and Safari. But I have a strange issue in Internet Explorer. What happens is, when I click on the imageDiv in my page, the deleteImage() method is getting invoked twice. One being the actual deleteimage() method thats given here and another is the deleteimage() method that I have in the page. How to resolve this issue. Please help.

    Read the article

  • Using jquery to disable function untill all selects are changed

    - by richbyte
    I am using a javascript function (F) (jquery )which uses 3 select values selected by the user to calculates a value - R(result) R is a number ranging from (1 through 9), (11) and (22); I need 2 extra steps one before the calculation and one after. a. Before calculation takes place: Make sure all three select values are changed before function(F) takes place. If not prompt the user with a notice ( create dom element/ I am using jquery) b. After the value R is calculated show an element corresponding to the result e.g. if R is 1 show an element ( a predetermined "link" element corresponding to each result value) thanks a lot.

    Read the article

  • Calling a function in a JavaScript file with Selenium IDE

    - by user1059903
    So, I'm running these Selenium IDE tests against a site I'm working on. Everything about the tests themselves is running fine, except I would like to do a bit of clean-up once I'm done. In my MVC3 Razor based site, I have a JavaScript file with a function that gets a JsonResult from a Controller of mine. That Controller handles the database clean-up that Selenium IDE otherwise couldn't handle. However, I'm having a hard time finding any sort of documentation on how to do this. I know I can do JavaScript{ myJavascriptGoesHere } as one of the Values for a line in the test, but I can't seem to find a way to tell it to go find my clean-up function. Is it even possible for Selenium IDE to do this sort of thing? If it comes down to it, I can just make a separate View to handle the clean-up, but I'd really like to avoid that if possible. Thanks!

    Read the article

  • jquery .load() function only gets called once

    - by user1288099
    the html <div class="stackwrapper" id="user1"></div> <div class="stackwrapper" id="user2"></div> <div class="userdrawings"></div> the javascript $('.stackwrapper').click(function(e){ var id=$(this).attr('id'); $('.userdrawings').load('loadSession.php?user='+id).fadeIn("slow"); }); Somehow it only works at once, only at the first click on stackwrapper, when I click on the second one, the function is not triggered again.

    Read the article

  • Need help in JQuery scroll function

    - by KillerFish
    I am developing a small project and i need a help in JQuery Scroll event. I wrote code loading data while scrolling using following code $(window).scroll(function(){ if ($(window).scrollTop() > ($(document).height() - $(window).height())*.75){ $('#loadingimage').css({"bottom":"10px", "right":"10px"}).fadeIn('fast'); $.ajax ({ type: "POST", url: "../../scroll_load.php", data: "letter="+letter+"&start="+start, success: function(msg) { $('#new_music_videos .appendvideos').append(msg).children(':last').hide().fadeIn('slow'); $('#loadingimage').fadeOut('fast'); } }); } }); But data loading while the scroll bar is moving at bottom of the screen only. How can i make it for scroll upto 3/4 of the screen. Thanks a Lot.

    Read the article

  • PHP: "Footer function"?

    - by Ricket
    I have a project. It has a good number of PHP files. Each of these files includes a standard header. They don't include a standard footer. Now I want to do something just before the end of every page. I can go through each page and add the footer code, but I was wondering if there is an easier way (and I think I've seen something like it before, though I might be mistaken). Is there a way to set a "hook" or "trigger" function that will be executed at the end of a page, from the included header PHP script? I'm thinking of something like set_error_handler but to handle a page close event. Or like C's atexit function.

    Read the article

  • Javascript Function wont submit form..

    - by Josh K
    Here is my function: function processCheck() { var numberClicked = 0; var frm = document.getElementById('form'); for (var i=0; i<form.elements.length; i++) { if (frm.elements[i].checked) numberClicked++; } if(numberClicked != 8) alert('Must choose 8 Teams'); else frm.submit(); } My forms name is 'form', here is my input: echo "<input type='button' name='submit' value='Update' onclick='processCheck()' />"; When i click the button and there is anything but 8 boxes selected it displays the alert, if there is 8 boxes it does nothing (<-- The problem). I have the form action set to another page.

    Read the article

  • Cannot read function written in baseform

    - by Nana
    I have a program (aspx page) which inherits the baseform. My baseform has a function which validates a session. But currently, the program runs to the page and it didnt go through the baseform and read the function. I dont know where i go wrong. no error pop out. I build the page, still no error. Below is the code which i call the baseform. public partial class TAView : BaseForm { protected override void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { base.Page_Load(sender,e); binddropdownlists(); } }

    Read the article

  • Creating methods with infinite overloads ? (.NET)

    - by MarceloRamires
    In C# you can do this: foo = string.Format("{0} {1} {2} {3} ...", "aa", "bb", "cc" ...); This method Format() accepts infinite parameters, being the first one how the string should be formatted and the rest are values to be put in the string. Today I've come to a situation where I had to get a set of strings and test them, then I remembered this language functionality, but I had no clue. After a few unsuccessful web searches, I've realised it would be more prudent to just get an array, which didn't make me quite satisfied. Q: How do I make a function that accepts infinite parameters? And how do I use it ?

    Read the article

  • Check for element equality in an animation function.

    - by Zardoz
    I have the the below code and would expect that in the first pass of the fadeTo function "yes" would be printed as those first two console logs tell me it is the same element. But it doesn't recognize them as equal. What do I miss here? var tds = self.element.find("td:nth-child(" + (columnIndex + 1) + ")"); tds.fadeTo(options.columnFadeOutTime, 0, function() { window.console.log(tds.first()); window.console.log($(this)); if ($(this) == tds.first()) { window.console.log("yes"); } else { window.console.log("no"); } }

    Read the article

  • jquery: animate function problem

    - by Syom
    i start learning jquery just yesterday. i have a div element with some content, and i want to hide it by changing it's height: here is the script <script type="text/javascript"> $(document).ready(function(){ $("#hide").click(function(){ $("#cont").animate({ height: '0' },1500); $("#cont").hide(); }); }); </script> <input type="button" value="hide" id="hide"> <div id="cont"> text here... </div> but it doesn't work, becouse it automaticaly sets display:block to #cont element, so after animation it starts to show. when i try to set display:none to #cont element, it doesn't happen. could you help me? thanks

    Read the article

  • comlen function in Java

    - by davit-datuashvili
    in c or c++ the function comlen is defined such int comlen(char *p,char *q){ int i=0; while *p && (*p++==*q++) i++; return i; } Is this code equivalent of this function? int comlen(String s,String m){ int i=0; while (i<s.length() && s.charAt(i)==m.charAt(i)){ i++; } return i; }

    Read the article

  • Multifunctioning in Javascript

    - by Starx
    The concept is running multiple functions concurrently. The reason is, I have a page which performs various actions through ajax. These actions includes making multiple backups of new files uploaded in the upload directory. But I want this process to be initiated by a moderator. As this is a very lengthy process(might even take hours to complete), it blocks others ajax requests from executing, until this process complete. I want to execute functions along with the previously executed function parallelly. I am using jQuery's Ajax to sent initiate the request.

    Read the article

  • Converting a macro to an inline function

    - by Rob
    I am using some Qt code that adds a VERIFY macro that looks something like this: #define VERIFY(cond) \ { \ bool ok = cond; \ Q_ASSERT(ok); \ } The code can then use it whilst being certain the condition is actually evaluated, e.g.: Q_ASSERT(callSomeFunction()); // callSomeFunction not evaluated in release builds! VERIFY(callSomeFunction()); // callSomeFunction is always evaluated Disliking macros, I would instead like to turn this into an inline function: inline VERIFY(bool condition) { Q_ASSERT(condition); } However, in release builds I am worried that the compiler would optimise out all calls to this function (as Q_ASSERT wouldn't actually do anything.) I am I worrying unnecessarily or is this likely depending on the optimisation flags/compiler/etc.? I guess I could change it to: inline VERIFY(bool condition) { condition; Q_ASSERT(condition); } But, again, the compiler may be clever enough to ignore the call. Is this inline alternative safe for both debug and release builds?

    Read the article

  • 7 - drupal overriding theme fucntions gettting notices

    - by welovedesign
    So I am overriding a theme function by putting the contents in my template.php module, the problem is that it it throwing up loads of undefined index notices because there are lots of functions that are defined in the module. How can I define these in the template.php file and prevent the notices. Note: I know i can turn them off 'uc_cart_block_content' => array( 'variables' => array( 'help_text' => NULL, 'items' => NULL, 'item_count' => NULL, 'item_text' => NULL, 'total' => NULL, 'summary_links' => NULL, 'collapsed' => TRUE, ), 'file' => 'uc_cart.theme.inc', ),

    Read the article

  • Improve C function performance with cache locality?

    - by Christoper Hans
    I have to find a diagonal difference in a matrix represented as 2d array and the function prototype is int diagonal_diff(int x[512][512]) I have to use a 2d array, and the data is 512x512. This is tested on a SPARC machine: my current timing is 6ms but I need to be under 2ms. Sample data: [3][4][5][9] [2][8][9][4] [6][9][7][3] [5][8][8][2] The difference is: |4-2| + |5-6| + |9-5| + |9-9| + |4-8| + |3-8| = 2 + 1 + 4 + 0 + 4 + 5 = 16 In order to do that, I use the following algorithm: int i,j,result=0; for(i=0; i<4; i++) for(j=0; j<4; j++) result+=abs(array[i][j]-[j][i]); return result; But this algorithm keeps accessing the column, row, column, row, etc which make inefficient use of cache. Is there a way to improve my function?

    Read the article

  • CouchDB: How to change view function via javascript?

    - by osti
    Hello Guys, I am playing around with CouchDB to test if it is "possible" [1] to store scientific data (simulated and experimental raw data + metadata). A big pro is the schema-less approach of CouchDB: we have to be very flexible with the metadata, as the set of parameters changes very often. Up to now I have some code to feed raw data, plots (both as attachments), and hierarchical metadata (as JSON) into CouchDB documents, and have written some prototype Javascript for filtering and showing. But the filtering is done on the client side (a.k.a. browser): The map function simply returns everything. How could I change the (or push a second) map function of a specific _design-document with simple browser-JS? I do not think that a temporary view would yield any performance gain... Thanks for your time and answers. [1]: of course it is possible, but is it also useful? feasible? reasonable?

    Read the article

  • Hitting a Button -> Executing any class function I give it in the parameters (C++)

    - by Barnes Noble
    Can anyone help me with class function parameter callbacks? I'm not so sure how to set it up in my code here: http://codepad.org/fvwHtDjQ Basically I've got a player and an enemy. I have two buttons. One button when clicked should let the player jump. The other should make the enemy hit something. When clicked, each button has to correspond to the class function in the parameters. I'm not sure how to set it up though.

    Read the article

  • How to create "lock" (stop updating of cells) in Excel?

    - by Oozi
    My question is pretty simple, but one to which I can't really find a solution myself. I use Excel quite frequently, but rarely the fancy stuff. Anyway, to the point: How do I create a dropmenu that will lock certain cells, rows or columns? (by lock I mean unable to change via hand and stops updating itself). Example: A1 = 5 B1 = A1 * 100 Can I "lock" the B1-cell, so that changing A1 will have no effect on B1 (Will remain at value 500)? I would preferably want to be able to "unlock" the cell as well, instead of simply making function into value. Is this possible? Thanks in advance!

    Read the article

  • Function to get a string and return same after processing in C

    - by C0de_Hard
    I am working on a code which requires a function. This function gets a string as input and returns a string. What I have planned so far is to get a str[], remove all $'s and spaces, and store this in another string which is returned later: char *getstring(char str[]) { int i=0; char rtn[255]; while (i<strlen(str)) { if (str[i] != " " || str[i] != "$" ) rtn[i] = str[i]; else rtn[i] = ''; } return str; } I dont feel like this will work. Any ideas?? :-S

    Read the article

  • Javascript function not working with an array

    - by Ryan Harvie
    Hi, i have this function which loops through an array of check boxes checking if the boxes value is equal to something in a text box, i dont know whats wrong. function checkValue(contain) { var boxes = document.getElementsByTagName("input"); for (var i = 0; i < boxes.length; i++) { if (boxes[i].name == "vote[]") { if (boxes[i].value.indexOf(contain.value) != -1) { boxes[i].checked = true; } } } } and this is how i call it OnClick="uncheckAll(); checkValue(document.getElementsByName("countrylist"));" this code is in side a echo in php which is like this echo ' ';

    Read the article

  • Automatic conversion between methods and functions in Scala

    - by fikovnik
    I would like to understand the rules when can Scala automatically convert methods into functions. For example, if I have following two methods: def d1(a: Int, b: Int) {} def r[A, B](delegate: (A, B) ? Unit) {} I can do this: r(d1) But, when overloading r it will no longer work: def r[A, B, C](delegate: (A, B, C) ? Unit) {} r(d1) // no longer compiles and I have to explicitly convert method into partially applied function: r(d1 _) Is there any way to accomplish following with the explicit conversion? def r[A, B](delegate: (A, B) ? Unit) {} def r[A, B, C](delegate: (A, B, C) ? Unit) {} def d1(a: Int, b: Int) {} def d2(a: Int, b: Int, c: Int) {} r(d1) // only compiles with r(d1 _) r(d2) // only compiles with r(d2 _) There is somewhat similar question, but it is not fully explained.

    Read the article

  • Javascript click function for multiple Classes

    - by Jason Bassett
    So basically I have this little social networking site which allow comments. I've built a comment section that will slide down once a user clicks "Comment" and it slides down under the users status. My problem is that right now, the JavaScript only works on ONE post ID, and not the rest obviously seeing you can only use an ID once. But of course if I use classes instead, All the comment sections slide down because now they're all the same class. See below for my HTML and JavaScript. So if someone has a better method out there, please help :) $(function () { $(".comment-box").slideUp(); //when "comment" is clicked, slide down the comment box. if ($(".comment-box-btn").click(function () { $(".comment-box").slideDown(); })); //when "cancel" is clicked, slide up the comment box. if ($(".close-comment-box").click(function () { $(".comment-box").slideUp() })); }); And here's the HTML used //anchor for "Comment" <a class="comment-box-btn" href="#"><i class="icon-comment"></i> Comment</a> //comment box <div class="row comment-box" style="display:none;"> <div class="col-md-12"> <form accept-charset="UTF-8" action="" method="post"> <textarea class="form-control animated" cols="180" id="new-comment" name="comment" placeholder="Comment.." rows="1"></textarea> <div class="text-right" style="margin-top:20px;"> <a class="btn btn-default close-comment-box" href="#"> <span class="glyphicon glyphicon-remove"></span> Cancel</a> <button class="btn btn-info" type="submit">Comment</button> </div> </form> </div> </div>

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >