Jump to content

Search the Community

Showing results for tags 'in'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. ACKNOWLEDGMENT and RESULTS: Let me begin by announcing my success in having merged Matomo and wordcount2.js into a dynamically loading word cloud that reflects visitor use of Grammar Captive's local search engines. It is a little slow in loading, but unfortunately everything related to Matomo is slow at this point -- this, despite my recent server upgrade that has sped everything up. If you would like to see the result, simply click on the menu option Word Cloud under Visitor Profile in the navigation bar on the Grammar Captive mainpage. And, now back to Javascript. Thank you everyone for your effort. BACKGROUND: In an effort to distinguish between visitor desire and Grammar Captive's ability to meet this desire, I am seeking to create another word cloud that measures only visitor behavior. The aforementioned word cloud reflects a matching of visitor desire with Grammar Captives ability to match it. It is not a true reflection of visitor desire. In order to achieve this latter I must count not the number of hits that visitors receive when they make a search, rather I must count the number of searches for a particular item. In order to do this I found a function on Stack Overflow that will likely be of help, if only I could understand it. The FUNCTION: function checkDuplicateInObject(propertyName, inputArray) { var seenDuplicate = false, testObject = {}; inputArray.map(function(item) { var itemPropertyName = item[propertyName]; if (itemPropertyName in testObject) { testObject[itemPropertyName].duplicate = true; item.duplicate = true; seenDuplicate = true; } else { testObject[itemPropertyName] = item; delete item.duplicate; } }); return seenDuplicate; } MY QUANDARY: The condition of the above function's if-statement appears to be self-defeating. Still, the function works, for I have tested it with my own data. Specifically, the variable testObject appears to contain an undefined object. It would appear then that the condition of the if-statement would always return false. As this is definitely not the case, I am at a loss as to how to interpret the condition. QUESTION: How is it that testObject can be empty and the condition still return true? Roddy
  2. The comment basically has my issue, but I'm basically trying to fix my second var prompt so it will actually run and I can't figure it out. If anyone can help I would greatly appreciate it. Line comment: var one above this comment isn't working, how do I fix it? I also need it to continue to the next else if statement once something is entered. I'm thinking of making it so that if it changes var input to 2 once it's entered then 3, will that work? <!DOCTYPE html> <html> <head> <title>Project 1 – Michael Fiorello</title> <script> do{ var input = prompt ("Please enter 1, 2, 3, or exit.");{ if (input == "1") {for var one = prompt ("Please enter a string"); //var one above this comment isn't working, how do I fix it? I also need it to continue to the next else if statement once something is entered. I'm thinking of making it so that if it changes var input to 2 once it's entered then 3, will that work? if (one != null) else console.warn("You need to enter something") }in(one !="") //need the above "in" to cause it to loop this section until something is entered for var one else if (input == "2") { alert ("COOL!") } else if (input == "3") { alert ("AWESOME!") } else if (input.toLowerCase() == "exit") { alert ("Okay") } else { alert ("Nope") console.warn("You need to enter something"); } } }while(input != "exit"); </script> </head> <body> </body> </html>
×
×
  • Create New...