Search Results

Search found 2842 results on 114 pages for 'undefined hero'.

Page 26/114 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Load local Html file doesn't refer the js file in UIWebView

    - by Hero Vs Zero
    I am working with UIWebView project and I want to load an HTML file from a project resource. It is working fine when I run from the URL, but when I view the HTML file locally, JS files are not loaded. Loading the local HTML local file doesn't refer to js files in UIWebView. Here's my code to load the HTML file project local resource and does't refer the js file: NSString *path = [[NSBundle mainBundle] pathForResource:@"textfile" ofType:@"txt"]; NSError *error = nil; NSString *string = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error]; NSString *path1 = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path1]; NSLog(@"%@ >>> %@",baseURL,path); [webview loadHTMLString:string baseURL:baseURL]; This code doesn't find JS files in UIWebView, even though it loads image files from the project resource successfully.

    Read the article

  • Extracting a sub-string in C#

    - by hero
    I am new to c# programming and I want to ask a question. How can I get the value in () and store it in another string. example: I have string s1="here there (hi)"; How can I get s2="hi"; the () will always be at the end of the sentence (never at first or in between).

    Read the article

  • using JQuery to search a treeview

    - by hero
    i have a texbox and a treeview. i want the user to search in the treeview by typing in the textbox. i think the best way to do it is using JQuery. how can i search for a word inside a treeview , color it, and focus on it using JQuery? a simple example would be great...

    Read the article

  • help with google android

    - by hero
    how powerfull is google android bluetooth programming? is it considered a low level programming langauge/emulator that enables me to have full control over bluetooth? ie protocols,encryption,layers....

    Read the article

  • connect to mysql using c++

    - by hero
    is it possible to connect to an mysql database and issue queries using c++? i found some sample code from the internet but they all use mysql! so u need to install mysql first on the computer. what i want is to use a program from different locations where i don't have mysql installed to access a remote mysql database. is this possible?

    Read the article

  • Parsing XML file using a for loop

    - by Johnny Spintel
    I have been working on this program which inserts an XML file into a MYSQL database. I'm new to the whole .jar idea by inserting packages. Im having an issue with parse(), select(), and children(). Can someone inform me how I could fix this issue? Here is my stack trace and my program below: Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method select(String) is undefined for the type Document The method children() is undefined for the type Element The method children() is undefined for the type Element The method children() is undefined for the type Element The method children() is undefined for the type Element at jdbc.parseXML.main(parseXML.java:28) import java.io.*; import java.sql.*; import org.jsoup.Jsoup; import org.w3c.dom.*; import javax.xml.parsers.*; public class parseXML{ public static void main(String xml) { try{ BufferedReader br = new BufferedReader(new FileReader(new File("C:\\staff.xml"))); String line; StringBuilder sb = new StringBuilder(); while((line=br.readLine())!= null){ sb.append(line.trim()); } Document doc = Jsoup.parse(line); StringBuilder queryBuilder; StringBuilder columnNames; StringBuilder values; for (Element row : doc.select("row")) { // Start the query queryBuilder = new StringBuilder("insert into customer("); columnNames = new StringBuilder(); values = new StringBuilder(); for (int x = 0; x < row.children().size(); x++) { // Append the column name and it's value columnNames.append(row.children().get(x).tagName()); values.append(row.children().get(x).text()); if (x != row.children().size() - 1) { // If this is not the last item, append a comma columnNames.append(","); values.append(","); } else { // Otherwise, add the closing paranthesis columnNames.append(")"); values.append(")"); } } // Add the column names and values to the query queryBuilder.append(columnNames); queryBuilder.append(" values("); queryBuilder.append(values); // Print the query System.out.println(queryBuilder); } }catch (Exception err) { System.out.println(" " + err.getMessage ()); } } }

    Read the article

  • twitter bootstrap typeahead 2.0.4 ajax error

    - by Adam Levitt
    I have the following code which definitely returns a proper data result if I use the 2.0.0 version, but for some reason bootstrap's typeahead plugin is giving me an error. I pasted it below the code sample: <input id="test" type="text" /> $('#test').typeahead({ source: function(typeahead, query) { return $.post('/Profile/searchFor', { query: query }, function(data) { return typeahead.process(data); }); } }); When I run this example I'm getting a jQuery bug that says the following: ** item is undefined matcher(item=undefined)bootst...head.js (line 104) <br/>(?)(item=undefined)bootst...head.js (line 91) <br/>f(a=function(), b=function(), c=false)jquery....min.js (line 2) <br/>lookup(event=undefined)bootst...head.js (line 90) <br/>keyup(e=Object { originalEvent=Event keyup, type="keyup", timeStamp=145718131, more...})bootst...head.js (line 198) <br/>f()jquery....min.js (line 2) <br/>add(c=Object { originalEvent=Event keyup, type="keyup", timeStamp=145718131, <br/>more...})jquery....min.js (line 3) <br/>add(a=keyup charCode=0, keyCode=70)jquery....min.js (line 3) <br/>[Break On This Error] <br/>return item.toLowerCase().indexOf(this.query.toLowerCase())** Any thoughts? ... The same code works in the 2.0.0 version of the plugin, but fails to write to my knockout object model.

    Read the article

  • configure.in: AM_DISABLE_SHARED doesn't change my Makefile

    - by t2k32316
    I'm extremely new to using Makefiles and autoconf. I'm using the Camellia image library and trying to statically link my code against their libraries. When I run "make" on the Camellia image library, I get libCamellia.a, .so, .la, and .so.0.0.0 files inside my /usr/local/lib directory. This is the command I use to compile my code with their libraries: gcc -L/usr/local/lib -lCamellia -o myprogram myprogram.c This works fine, but when I try to statically link, this is what I get: gcc -static -L/usr/local/lib -lCamellia -o myprogram myprogram.c /tmp/cck0pw70.o: In function `main': myprogram.c:(.text+0x23): undefined reference to `camLoadPGM' myprogram.c:(.text+0x55): undefined reference to `camAllocateImage' myprogram.c:(.text+0x97): undefined reference to `camZoom2x' myprogram.c:(.text+0x104): undefined reference to `camSavePGM' collect2: ld returned 1 exit status I want to statically link because I'm trying to modify the Camellia source code and I want to compare my version against theirs. So after some googling, I tried adding AM_DISABLE_SHARED into the configure.in file. But after running ./configure, I still get the exact same Makefile. After I "make install", I still get the same results above. What is an easy way to get two versions of my code, one with the original Camellia source code compiled and one with my modified version? I think static libraries should work. There is an easy way to get static libraries working or are there other simple solutions to my problem? I just don't want to re-"make" and re-"make install" everytime I want to compare my version against the original.

    Read the article

  • Jquery - binding click event to a variable

    - by Kayote
    All, I am really stuck/ confused at this point. I have an array with 6 items in it. Each item in the array is dynamically filled with elements using jquery '.html' method. However, I cannot seem to be able to attach/ bind an event to this dynamically created variable. As soon as the browser gets to the problem line (see the area labeled 'PROBLEM AREA'), I get a 'undefined' error, which is really confusing as all the previous code on the very same variable works just fine. var eCreditSystem = document.getElementById("creditSystem"); var i = 0; var eCreditT = new Array(6); // 6 members created which will be recycled function createCreditTransaction () // func called when a transaction occurs, at the mo, attached to onclick() { if (i < 6) { eCreditT[i] = undefined; // to delete the existing data in the index of array addElements (i); } else if (i > 5 || eCreditT[i] != undefined) { ... } } function addElements (arrayIndex) // func called from within the 'createCreditTransaction()' func { eCreditT[i] = $(document.createElement('div')).addClass("cCreditTransaction").appendTo(eCreditSystem); $(eCreditT[i]).attr ('id', ('trans' + i)); $(eCreditT[i]).html ('<div class="cCreditContainer"><span class="cCreditsNo">-50</span>&nbsp;<img class="cCurrency" src="" alt="" /></div><span class="cCloseMsg">Click box to close.</span><div class="dots"></div><div class="dots"></div><div class="dots"></div>'); creditTransactionSlideOut (eCreditT[i], 666); // calling slideOut animation console.log(eCreditT[i]); // this confirms that the variable is not undefined /* ***** THE PROBLEM AREA ***** */ $(eCreditT[i]).on ('click', function () // if user clicks on the transaction box { creditTransactionSlideBackIn (eCreditT[i], 150); // slide back in animation }); return i++; }

    Read the article

  • How should I define a JavaScript 'namespace' to satisfy JSLint?

    - by Matthew Murdoch
    I want to be able to package my JavaScript code into a 'namespace' to prevent name clashes with other libraries. Since the declaration of a namespace should be a simple piece of code I don't want to depend on any external libraries to provide me with this functionality. I've found various pieces of advice on how to do this simply but none seem to be free of errors when run through JSLint (using 'The Good Parts' options). As an example, I tried this from Advanced JavaScript (section Namespaces without YUI): "use strict"; if (typeof(MyNamespace) === 'undefined') { MyNamespace = {}; } Running this through JSLint gives the following errors: Problem at line 2 character 12: 'MyNamespace' is not defined. Problem at line 3 character 5: 'MyNamespace' is not defined. Implied global: MyNamespace 2,3 The 'Implied global' error can be fixed by explicitly declaring MyNamespace... "use strict"; if (typeof(MyNamespace) === 'undefined') { var MyNamespace = {}; } ...and the other two errors can be fixed by declaring the variable outside the if block. "use strict"; var MyNamespace; if (typeof(MyNamespace) === 'undefined') { MyNamespace = {}; } So that works, but it seems to me that (since MyNamespace will always be undefined at the point it is checked?) it is equivalent to the much simpler: "use strict"; var MyNamespace = {}; JSLint is content with this but I'm concerned that I've simplified the code to such an extent that it will no longer function correctly as a namespace. Is this final formulation sensible?

    Read the article

  • Error in connection in ruby.

    - by piemesons
    require 'rubygems' require 'mysql' db = Mysql.connect('localhost', 'root', '', 'mohit') //db.rb:4: undefined method `connect' for Mysql:Class (NoMethodError) //undefined method `real_connect' for Mysql:Class (NoMethodError) db.query("CREATE TABLE people ( id integer primary key, name varchar(50), age integer)") db.query("INSERT INTO people (name, age) VALUES('Chris', 25)") begin query = db.query('SELECT * FROM people') puts "There were #{query.num_rows} rows returned" query.each_hash do |h| puts h.inspect end rescue puts db.errno puts db.error end error i am geting is: undefined method `connect' for Mysql:Class (NoMethodError) OR undefined method `real_connect' for Mysql:Class (NoMethodError) EDIT return value of Mysql.methods ["private_class_method", "inspect", "name", "tap", "clone", "public_methods", "object_id", "__send__", "method_defined?", "instance_variable_defined?", "equal?", "freeze", "extend", "send", "const_defined?", "methods", "ancestors", "module_eval", "instance_method", "hash", "autoload?", "dup", "to_enum", "instance_methods", "public_method_defined?", "instance_variables", "class_variable_defined?", "eql?", "constants", "id", "instance_eval", "singleton_methods", "module_exec", "const_missing", "taint", "instance_variable_get", "frozen?", "enum_for", "private_method_defined?", "public_instance_methods", "display", "instance_of?", "superclass", "method", "to_a", "included_modules", "const_get", "instance_exec", "type", "<", "protected_methods", "<=>", "class_eval", "==", "class_variables", ">", "===", "instance_variable_set", "protected_instance_methods", "protected_method_defined?", "respond_to?", "kind_of?", ">=", "public_class_method", "to_s", "<=", "const_set", "allocate", "class", "new", "private_methods", "=~", "tainted?", "__id__", "class_exec", "autoload", "untaint", "nil?", "private_instance_methods", "include?", "is_a?"] return value of Mysql.methods(false) is []... blank array

    Read the article

  • How to open popup behind main window (HTML,jQuery)

    - by sara.ma
    I'm new. i have a popup code that when user click anywhere in the HTML page, a popup window shows up: (function () { document.onclick = function () { var sUrl = "http://URL.com"; if (typeof daily_capping == "undefined") var daily_capping = 10; if (typeof capping_minutes == "undefined") var capping_minutes = 60; if (document.cookie.indexOf("_popwin=") === -1) { var ads2day = document.cookie.split("_popwinDaily=")[1]; ads2day = typeof ads2day == "undefined" ? 0 : parseInt(ads2day.split(";")[0]); if (ads2day < daily_capping) { var isMSIE = navigator.userAgent.indexOf("MSIE") != -1 ? !0 : !1, _parent = self, sOptions, popunder; if (top != self) try { top.document.location.toString() && (_parent = top) } catch (err) {} sOptions = "toolbar=no,scrollbars=yes,location=yes,statusbar=yes,menubar=no,resizable=1,width=" + screen.width.toString() + ",height=" + (screen.height - 20).toString() + ",screenX=0,screenY=0,left=0,top=0", popunder = _parent.window.open(sUrl, "rhpop", sOptions); if (popunder) { popunder.blur(); if (isMSIE) { window.focus(); try { opener.window.focus() } catch (err) {} } else popunder.init = function (e) { with(e)(function () { if (typeof window.mozPaintCount != "undefined" || typeof navigator.webkitGetUserMedia == "function") { var e = window.open("about:blank"); e.close() } try { opener.window.focus() } catch (t) {} })() }, popunder.params = { url: sUrl }, popunder.init(popunder) } var now = new Date, popDaily = (new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 23, 59, 59)).toGMTString(); document.cookie = "_popwinDaily=" + (ads2day + 1) + ";expires=" + popDaily + ";path=/"; var popInterval = new Date; popInterval.setTime(popInterval.getTime() + capping_minutes * 60 * 1e3), document.cookie = "_popwin=1;expires=" + popInterval.toGMTString() + ";path=/" } } } })(); but popup is on top. is it possible to make it open behind main page?? is there any lighter popup code for this purpose? thanks guys

    Read the article

  • dwoo template variables inside JavaScript?

    - by user344711
    Hi everyone! i have this code. {if $loginUrl} {literal} <script type="text/javascript"> var newwindow; var intId; function login() { var screenX = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft, screenY = typeof window.screenY != 'undefined' ? window.screenY : window.screenTop, outerWidth = typeof window.outerWidth != 'undefined' ? window.outerWidth : document.body.clientWidth, outerHeight = typeof window.outerHeight != 'undefined' ? window.outerHeight : (document.body.clientHeight - 22), width = 500, height = 270, left = parseInt(screenX + ((outerWidth - width) / 2), 10), top = parseInt(screenY + ((outerHeight - height) / 2.5), 10), features = ( 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top ); newwindow=window.open('{$loginUrl}','Login by facebook',features); if (window.focus) {newwindow.focus()} return false; } </script> {/literal} {/if} It is dwoo templates, i wonder how can i use my dwoo variables inside javascript? im trying to do it just at you can see at the code, but it doesnt work. I need to warp my code between {literal} so it can work.

    Read the article

  • javascript for (i = 0; i < XXX.length; i++) -> length question

    - by Fernando SBS
    for (m = 0; m < troopsCount.length; m++) { //FM_log(7,"i="+i+" m="+m); //FM_log(7,"tipoTropaPrioritaria[m] = "+tipoTropaPrioritaria[m]); //FM_log(7,"troopsCount[m] = "+troopsCount[m]); //FM_log(7,"availableTroops[m] = "+availableTroops[m]); if ((tipoTropaPrioritaria[m] == null || tipoTropaPrioritaria[m] == "undefined") || (troopsCount[m] == null || troopsCount[m] == "undefined") || (availableTroops[m] == null || availableTroops[m] == "undefined")) return "alternaTropas(): ERRO - tipoTropaPrioritaria[m] || troopsCount[m] || availableTroops[m] null ou undefined"; if ((parseInt(tipoTropaPrioritaria[m]) != 0) && (parseInt(troopsCount[m]) != 0)) { naoServe = true; break; } else { if ((parseInt(availableTroops[m])) < (parseInt(troopsCount[m]))) { naoServe = true; break; } else if (m < troopsCount.length) { naoServe = true; } else { //means m >= troopsCount.length naoServe = false; } } } my question is: the last statement else { //means m >= troopsCount.length naoServe = false; } will it ever be evaluated since for (m = 0; m < troopsCount.length; m++) ???

    Read the article

  • Deleted array value still showing up on foreach loop in AS3 (bug in flash?)

    - by nexus
    It took me many hours to narrow down a problem in some code to this reproducible error, which seems to me like a bug in AVM2. Can anyone shed light on why this is occurring or how to fix it? When the value at index 1 is deleted and a value is subsequently set at index 0, the non-existent (undefined) value at index 1 will now show up in a foreach loop. I have only been able to produce this outcome with index 1 and 0 (not any other n and n-1). Run this code: package { import flash.display.Sprite; public class Main extends Sprite { public function Main():void { var bar : Array = new Array(6); out(bar); //proper behavior trace("bar[1] = 1", bar[1] = 1); out(bar); //proper behavior trace("delete bar[1]", delete bar[1]); out(bar); //proper behavior trace("bar[4] = 4", bar[4] = 4); out(bar); //for each loop will now iterate over the undefined position at index 1 trace("bar[0] = 0", bar[0] = 0); out(bar); trace("bar[3] = 3", bar[3] = 3); out(bar); } private function out(bar:Array):void { trace(bar); for each(var i : * in bar) { trace(i); } } } } It will give this output: ,,,,, bar[1] = 1 1 ,1,,,, 1 delete bar[1] true ,,,,, bar[4] = 4 4 ,,,,4, 4 bar[0] = 0 0 0,,,,4, 0 undefined 4 bar[3] = 3 3 0,,,3,4, 0 undefined 4 3

    Read the article

  • SQL SERVER – Caption the Cartoon Contest – Last 2 Days

    - by pinaldave
    Developer’s life is very interesting, we often want to start my day early at a job so we can go home early. However, the day never comes as the life of the developer is always about working late hours. If the developer goes to the office early – there are good chances that his co-workers will come late. Additionally, I am confident that there will be always something urgent for developers or DBA to solve right at the time they are ready to go home. This is the life of the developers!  Here is the interesting story of a DBA who was about to go to the home. He had to take his girlfriend to a movie and dinner in 30 minutes. However, his manager asks him to fix the performance related issues with their production server. In normal case, he had only two choices a) Job or b) Girlfriend. Well, our super hero DBA decided to use efficient tools and improve the performance of the production server in merely 30 minutes. When he was done, his manager was absolutely surprised by his efficiency and accuracy of the work. He asked him following question - Here is the contest – you need to guess what was the answer of our Super Hero DBA. If you guess the answer correct you may win Star Wars R2-D2 Inflatable Remote Controlled device. Additionally, if you Download DB Optimizer before Dec 8, 2012 – you will be eligible for USD 25 Amazon Gift Card (there are total 10 such awards). Please do not leave comments in this thread – to participate in the contest – please leave a comment here in the original contest page. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Php pdo_dblib - cannot find/unable to load freetds

    - by MaxPowers
    Self-hosted box, RHEL 6 PHP 5.3.3 PDO installed freetds installed pdo_dblib - so far no luck installing My goal is to use PDO with sybase. Attempting to install pdo_dblib from the appropriate version php source code. I have tried a variety of methods and searched quite a bit for help on this topic, but have yet to be successful. Method 1 Install freetds $ ./configure $ make $ su root Password: $ make install This is successful Install pdo_dblib inside the /ext/pdo_dblib folder: $ phpize $ ./configure $ make $ make test Error output: PHP Warning: PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0 That doesn't look good...I researched this and found an interesting hack for this here. But changing pdo.ini to pdo_0.ini was not the solution, as I still got the same errors on make test. $ su $ make install Output: Installing shared extensions: /usr/lib64/php/modules/ That seems strange...and no, it doesn't actually install (not showing up on phpinfo after apache restart). Method 2 Install freetds following the instructions exactly, i add the prefix $ ./configure --prefix=/usr/local/freetds $ make $ su root Password: $ make install This is successful Install pdo_dblib inside the /ext/pdo_dblib folder: $ phpize $ ./configure --with-sybase=/usr/local/freetds This produces the following error at the bottom of the output ... checking for PDO_DBLIB support via FreeTDS... yes, shared configure: error: Cannot find FreeTDS in known installation directories Method 3 freetds ./configure variation (including or not include the --prefix...) did not change the result of this so I'll skip it. Install pdo_dblib pecl extension following the method specified here. pecl download pdo_dblib tar -xzvf PDO_DBLIB-1.0.tgz Removed the line, <dep type=”ext” rel=”ge” version=”1.0?>pdo</dep> Saved the package.xml file, and moved it in to the PDO_DBLIB directory. mv package.xml ./PDO_DBLIB-1.0 Navigated to the PDO_DBLIB directory, then installed the package from the directory. cd ./PDO_DBLIB-1.0 pecl install package.xml But, this command gives me the following error output, same as Method 2. checking for PDO_DBLIB support via FreeTDS... yes, shared configure: error: Cannot find FreeTDS in known installation directories ERROR: `/home/sybase/Install_items/pecl_pdo_dblib/PDO_DBLIB-1.0/configure' failed

    Read the article

  • How can I use Boost::regex.hpp library in C++?

    - by MIH1406
    I tried to use Boost library but I failed, see my code: #include "listy.h" #include <boost/regex.hpp> using namespace boost; ListyCheck::ListyCheck() { } ListyCheck::~ListyCheck() { } bool ListyCheck::isValidItem(std::string &__item) { regex e("(\\d{4}[- ]){3}\\d{4}"); return regex_match(__item, e); } When I tried to compile it I get those messages: /usr/include/boost/regex/v4/regex_match.hpp:50: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator , std::allocator, std::allocator , boost::regex_traits ::match()' /usr/include/boost/regex/v4/basic_regex.hpp:425: undefined reference to `boost::basic_regex ::do_assign(char const*, char const*, unsigned int)' /usr/include/boost/regex/v4/perl_matcher.hpp:366: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator , std::allocator, std::allocator , boost::regex_traits ::construct_init(boost::basic_regex const&, boost::regex_constants::_match_flags)' etc...

    Read the article

  • Javascript onscroll and mouse position

    - by EddyR
    I have a script that runs a addEventListener for onmousemove and onscroll on the document body to get the cursor position. A onmousemove event works fine (client + scroll), however when a onscroll event occurs clientX/Y seems to inherit scrollTop/Left values instead (only scroll). Is there a way around this? clickDocument = (document.documentElement != undefined && document.documentElement.clientHeight != 0) ? document.documentElement : document.body; var posx = 0; var posy = 0; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX; posy = e.clientY; } var scrollx = window.pageXOffset == undefined ? clickDocument.scrollLeft : window.pageXOffset; var scrolly = window.pageYOffset == undefined ? clickDocument.scrollTop : window.pageYOffset;

    Read the article

  • Change JS alert to DOM error message div

    - by Jason
    I need to convert my error messaging to a positioned div (hidden initially) instead of the standard js alert. I realize I need to push the alert message to the DOM, but I'm new to javascript. Any help would be appreciated. Additionally, I need to do it without a confirm (so error message removes on field focus) if(el != null) { switch(el.name) { case "firstName": //First Name Field Validation, Return false if field is empty if( f.firstName.value == "" ) { alert( bnadd_msg_002 ); if ((typeof TeaLeaf != "undefined") && (typeof TeaLeaf.Client != "undefined") && (typeof TeaLeaf.Client.tlAddEvent != "undefined") ) { var nVO = { ErrorMessage : bnadd_msg_002} var subtype="CustomErrorMsg"; TeaLeaf.Event.tlAddCustomEvent(subtype, nVO); } return false; } break;

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >