dcsimg
www.webdeveloper.com

Search:

Type: Posts; User: Tcobb

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    6
    Views
    1,113

    As you've probably noticed if you have tried to...

    As you've probably noticed if you have tried to run that code

    var country = {US = "2105" UK = "1103" GER = "704" ESP = "1918" AUS = "115" CAN = "304"}

    that's not a correct way to write a...
  2. Replies
    6
    Views
    1,113

    Look at generic javascript "objects," which are...

    Look at generic javascript "objects," which are essentially name-value pairs. This would probably be the easiest route to go.
  3. Replies
    10
    Views
    1,464

    Maybe I misunderstood what the OP was asking for....

    Maybe I misunderstood what the OP was asking for. I was under the impression he wanted to have a mechanism for allowing a user to click on an element if they wanted more information in which case...
  4. Replies
    10
    Views
    1,464

    Although there isn't currently support for this...

    Although there isn't currently support for this in IE or Firefox you might look at the HTML5 DETAILS/SUMMARY tags. I'm not totally sure but I think there is a polyfill which implements them if the...
  5. Replies
    2
    Views
    770

    1. If its on the same domain as the web page you...

    1. If its on the same domain as the web page you can use AJAX

    2. If its on a different domain you can simply use a form. If you don't want to change the primary page after sending the form info...
  6. --- nickgeek Just so you understand, a lot of...

    --- nickgeek

    Just so you understand, a lot of developers have fallen for the "work for equity" thing, which in many real life incidents actually translates as "you get to do all the work, and if...
  7. Replies
    18
    Views
    2,422

    Other You are welcome. As a parting comment I would...

    You are welcome. As a parting comment I would urge you, from a performance perspective, to incorporate the code from the "goDeep" function into the "objSort" function. If you have a lot of entries...
  8. Replies
    2
    Views
    480

    When you use "document.getElementById" it returns...

    When you use "document.getElementById" it returns a reference to the HTML element rather than what it contains, which is the number value you want.

    Instead of

    var a =...
  9. Replies
    18
    Views
    2,422

    Other The first alternative.

    The first alternative.
  10. Replies
    18
    Views
    2,422

    Other Okay-- I assumed (incorrectly) that the objects...

    Okay-- I assumed (incorrectly) that the objects in the array had properties whose values were 'primitives' rather than objects in which you would need to seek further down. As written the function I...
  11. Replies
    18
    Views
    2,422

    Other Whoops--- I didn't explain how to do a...

    Whoops---

    I didn't explain how to do a "nested" sort with this. Basically you just resort from least to most important field. For example, lets say you have an array of objects each of which...
  12. Replies
    18
    Views
    2,422

    Other This should do it for you: function...

    This should do it for you:


    function objSort(arr, field, mode){
    var i, len, val, unique, all, ret;
    unique = []; all = {}; ret = [];
    len = arr.length;
    for(i = 0; i < len; i++){
    val...
  13. Replies
    4
    Views
    784

    Although there will be problems with older...

    Although there will be problems with older browsers, you can iterate through the <a> elements and check their someElement.textContent as well.
  14. Replies
    8
    Views
    1,280

    It can be done if you don't mind committing what...

    It can be done if you don't mind committing what is (to some people) the unpardonable sin of using 'eval'


    function speak(){ //just prints all args sent to it
    var i, z = arguments.length;...
  15. Replies
    2
    Views
    534

    Other If you are interested in asynchronous javascript,...

    If you are interested in asynchronous javascript, you might wish to explore the following topics via a search engine:

    (1) AJAX if getting data from the web server
    (2) Web Workers for local time...
  16. Replies
    7
    Views
    1,141

    I apologize. My code was bad and I didn't look...

    I apologize. My code was bad and I didn't look at yours closely at all.
    This does work on my machine:


    var http = require('http');
    var fs = require("fs");

    var file =('try.html');
  17. Replies
    7
    Views
    1,141

    If you want to grab a file, use the fs module...

    If you want to grab a file, use the fs module like so:



    http = require('http');
    fs = require("fs");

    var file =('try.html');
  18. Replies
    7
    Views
    1,141

    You might try something like this: var http...

    You might try something like this:


    var http = require('http');

    var page = '<html><head></head><body>Hello World!</body></html>';



    http.createServer(function (req, res) {
  19. Replies
    3
    Views
    483

    Omit the quotation marks. var a="cat"; ...

    Omit the quotation marks.

    var a="cat";

    write:


    var a = cat;
    alert(cat.name); //alerts Harmony
  20. Replies
    1
    Views
    418

    You can use something like this: function...

    You can use something like this:


    function subtractArr(field, mainArr, badArr){
    var i, len, ret, key, tmp;
    key = {};
    ret = [];
    len = badArr.length;
    while(len--){ ...
  21. A lot depends upon what you are using the objects...

    A lot depends upon what you are using the objects for and how many of them you need to create. If you create an object with the "new" operator you have the option of adding new properties/functions...
  22. Replies
    3
    Views
    729

    Closures and scope. At first I could get the...

    Closures and scope.

    At first I could get the text to appear in the PRE tag, but no matter what button I pushed
    it read 'Button 5' --that indicated a closure problem. So, in your for loop:

    ...
  23. Replies
    3
    Views
    670

    True. I missed the fact that 'i' was the name of...

    True. I missed the fact that 'i' was the name of the argument.

    --Sorry about that . . .
  24. Replies
    3
    Views
    670

    If you look, the function is changing the value...

    If you look, the function is changing the value of global 'i' and 'bar', but it doesn't change the value of global 'foo' because a local 'foo' is declared in the function with a 'var' statement.
  25. Replies
    5
    Views
    770

    Odd. When I ran it console.log("this",...

    Odd. When I ran it
    <code>console.log("this", this.x);</code>
    did display "undefined"

    ~~~note: run on node.js, not through a browser
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4
HTML5 Development Center



Recent Articles