Jump to content

davej

Moderator
  • Content count

    3,935
  • Joined

  • Last visited

  • Days Won

    85

davej last won the day on August 15

davej had the most liked content!

Community Reputation

243 Excellent

4 Followers

About davej

  • Rank
    davej
  • Birthday July 15

Contact Methods

  • MSN
    e-mail: davejonline@hotmail.com

Profile Information

  • Gender
  • Location
    STL
  • Interests
    Learning web development.

Recent Profile Visitors

63,305 profile views
  1. Problem Connecting to MySQL

    Show us the include statement that you use, and are all the php files together in one folder?
  2. Problem Connecting to MySQL

    Your question doesn't make any sense. Can the browser display the page?
  3. var a = ["123", 123, "1a2b3c", 122.222, "A"]; for(var i=0 ; i<a.length ; i++){ if(isNaN(a[i])){ alert('a['+i+'] is not a number (nan)'); } }
  4. Structuring the PHP site

    Obviously you have appropriate fields in your user database and then load session variables when the user logs in.
  5. Because the string "A" cannot be converted to a number.
  6. How to return an int in java

    This code demonstrates the use of methods, similar to what you seemed to be attempting to do. Obviously sendKeys() requires a string rather than an integer. public class Newcoder0001 { public static void main(String[] args) { // Create a new instance of the Firefox driver // Notice that the remainder of the code relies on the interface, // not the implementation. WebDriver driver = new FirefoxDriver(); // And now use this to visit myPage driver.get("http://www.myPage.com"); // Alternatively the same thing can be done like this // driver.navigate().to("http://www.myPage.com"); enterPhoneExt(driver, 999); /* // Now submit the form. WebDriver will find the form for us from the element element.submit(); // Check the title of the page System.out.println("Page title is: " + driver.getTitle()); // Google's search is rendered dynamically with JavaScript. // Wait for the page to load, timeout after 10 seconds (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver d) { return d.getTitle().toLowerCase().startsWith("cheese!"); } }); // Should see: "cheese! - Google Search" System.out.println("Page title is: " + driver.getTitle()); //Close the browser driver.quit(); */ }// end of main static void enterPhoneExt(WebDriver driver, int max){ WebElement element = driver.findElement(By.name("PhoneExtField")); // select element element.clear(); int n = generateRandomNumber(max); element.sendKeys( String.valueOf(n) ); // insert int as a string }// end of method static int generateRandomNumber(int max){ Random rand = new Random(); int n = rand.nextInt(max-1) + 1; return n; }// end of method }// end of class
  7. How to return an int in java

    Let's start with example code and then modify it. The following is from the seleniumhq.org example public class Selenium2Example { public static void main(String[] args) { // Create a new instance of the Firefox driver // Notice that the remainder of the code relies on the interface, // not the implementation. WebDriver driver = new FirefoxDriver(); // And now use this to visit Google driver.get("http://www.google.com"); // Alternatively the same thing can be done like this // driver.navigate().to("http://www.google.com"); // Find the text input element by its name WebElement element = driver.findElement(By.name("q")); // Enter something to search for element.sendKeys("Cheese!"); // Now submit the form. WebDriver will find the form for us from the element element.submit(); // Check the title of the page System.out.println("Page title is: " + driver.getTitle()); // Google's search is rendered dynamically with JavaScript. // Wait for the page to load, timeout after 10 seconds (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver d) { return d.getTitle().toLowerCase().startsWith("cheese!"); } }); // Should see: "cheese! - Google Search" System.out.println("Page title is: " + driver.getTitle()); //Close the browser driver.quit(); } }
  8. How to return an int in java

    Do you really need to use multiple classes and inheritance?
  9. How to return an int in java

    What are you actually trying to do?
  10. How to return an int in java

    This code makes no sense. Is this supposed to be Selenium/WebDriver stuff?
  11. html5 canvas

    See... Canvas Intro Canvas Reference Canvas drawImage
  12. How to make an online program offline

    Yes, if you are only communicating via the internet, and not using a browser, but each language is different. You would not use the same code or probably even the same language in Windows as you would in Linux.
  13. How to make an online program offline

    You have a program written in what? It seems to me that this is either an Android Java question or an iOS Swift question. Or is it Javascript that was loaded from a website which it has now lost connectivity to? Which is it?
  14. Ingolme just discussed this topic in a Php thread. You would use the same Javascript but direct it to your servlet url. AJAX_PHP
  15. As the last item at the bottom of the body add your code or; <script>document.write('<br>'+document.URL);</script>
×