Jump to content

skaterdav85

Members
  • Content Count

    874
  • Joined

  • Last visited

Everything posted by skaterdav85

  1. Doing that only returns the innerHTML of the first items in the collection.Looks like my best bet is to just duplicate data. I didn't want to do this because now the server has to iterate over the data twice, once to create the JS array, and another time to place the data within the DOM.
  2. I have a long list of items that I want the user to be able to filter by typing into a textbox. Once the user has found the item they are looking for, they can do something with it.
  3. I have a container div #divContainer that holds 1073 other div's with a class of .eachDiv. I have a text input #search-input where i search through each .eachDiv within #divContainer on the keyup event. The problem is that it seems a little laggy when I type, and I am not sure how to fix this. I realize it is iterating over a lot of items for each keyup which causes the slowness, and I was wondering if anyone had suggestions on how to improve the performance or my approach. I am using jQuery. var collection = $('#divContainer .eachDiv');var search = function ($collection, searchPhrase) { $c
  4. thanks JSG. so does the prototype object inherit all the properties and methods of the object it is a part of, which is why you can call slice on prototype? I just looked up the arguments variable that comes with functions and apparently it is an object that has a few similarities as an array.http://www.seifi.org/javascript/javascript-arguments.html
  5. Can someone help decipher this function? function createBoundWrapper(obj, fn) { return function () { return fn.apply(obj, Array.prototype.slice.call(arguments)); }} I think I understand most of it. createBoundWrapper returns a function that, when executed, calls fn with obj as the supplied context for this and it passes an array as data. What I don't quite get is why it says Array.prototype.slice.call(arguments)Why not just Array.slice.call(arguments)?My guess is that I don't fully understand the prototype object. All I really know about it is that it is used to add methods and propert
  6. i was planning on attributing each site for each news item from the RSS feed. I just wasn't sure if this was legal. I guess I can just ask them.
  7. I created a fan site for a band i like using several web services. I found other fan sites that publish news frequently and they have RSS feeds. Is it legal to ###### in the contents of RSS feeds from other sites using cURL or file_get_contents() and display them on my own, which is essentially what i do with the web services except these are RSS feeds? Basically my site would be an RSS reader of these other fan sites but with some extra stuff of my own. Or do i need to ask for permission to read these RSS feeds?
  8. thanks! i didn't know about those methods for reading style properties. i always wondered how jQuery did that. that was a great article that summed it up too.
  9. you can also read the values of style properties but only for inline styles of elements. I'm not sure how you would read the computed style of an element, such as the color of an element, if it was applied in an external stylesheet or style block somewhere on your page.jQuery actually will read the computed styles of an element that is wrapped in the jQuery object using the .css() method and passing it no arguments. No idea how it does this though.
  10. ya there doesn't seem to be a clear hierarchy. I was just aware that document is a property of window and both are global. I wasn't sure how navigator fit in, but based on my test, i think navigator is 'on the same level' as window, rather than being a property of window.
  11. I had a feeling that was the answer. What would be the best way to solve this then? Just pick a library and use what I need? Maybe something like YUI might be best for this since I think it allows you to load certain modules, thus reducing the overhead of components you don't need.
  12. well i wanted to find a hierarchical tree of everything available to a JS developer.
  13. That seems a little messy too, since I don't know how the function operates outside of the jQuery object. I guess when developers really need to use animated UI effects, they use libraries or end up writing their own. I was hoping there was a lightweight package of animation functions that could be used to implement into a custom library, similar to how Sizzle is available for implementing DOM element retrieval using CSS selectors in JS.
  14. Is the window an object property of the navigator object?I was looking at http://www.comptechdoc.org/independent/web...avaobjheir.html and it says the window object is a property of the navigator object, but when you run the following peice of code, the alert does not come up. Any ideas? if (navigator.window) { alert(navigator.userAgent);}
  15. Are there any JS animation objects / functions available out there than can be used to incorporate into a custom library? I've created an app that uses raw JS, but it would be nice if I could have a few functions available to perform some slight animation effects like fading in. I know I could use another library like jQuery, but it it seems overkill to load the entire library for one transition effect.
  16. I never really understood the difference between using elem.getAttribute() or accessing an attribute using the dot property approach like elem.id. Anyone know the difference?
  17. wow, awesome! Thanks boen! So does that mean libraries like Sizzle must perform some complex parsing using the basic methods i mentioned above to fetch elements based on a selector in IE 6/7, which would take much longer than in modern browsers?
  18. If some browsers support it natively, how would you use that to say, fetch all <li> elements within a <ul> with an id of "nav"? I did not know this. Sizzle looks like a great way to implement selectors if you wanted to build your own library.The reason I ask this is because I was developing an app at work using raw JS as I wanted to improve my raw JS skills and be less dependent on a library, but as I was doing this, I found it hard to target a specific set of elements since I was only aware of the standard techniques. Looks like I could have used Sizzle for this. =) Has anyone use
  19. I was wondering, how does a JS library like jQuery implement selectors, from a general point of view? The only thing I can think of is that it parses the selector such as 'div#nav ul li' and then behind the scenes it uses getElementById(), getElementsByTagName(), childNodes, and parentNode to filter through an initial, larger collection and return a smaller, filtered collection based on the selector you typed. Or is there some other magic going on that I don't know about?
  20. I have a friend who wants to start a Groupon-like site, where you have daily deals for a particular subject. Apparently there are several packages you can buy which provide the typical daily-deal site functionality. I looked at a few online but I am not sure which one is best. He is also concerned with customizing the design/theme, which I said I would do. Anyone have any recommendations?
  21. thanks guys. scrollIntoView() is exactly what I am looking for. I didn't even know about this method.
  22. You know how you can jump down/up to a particular part of the page if you put the element's id in the url? So by putting the id in the href attribute of an anchor, you can cause the page to jump to that id. <div id="div1">this is my div</div><a href="#div1">somewhere on the page</a> Is there a way to control this behavior in JavaScript? I have points on a map and each point knows which ID to jump to, but I don't know how to tell it to jump to a particular ID on the page when clicked. I have already added a click event listener to each point. I just need to make it do
  23. so i finally got the site to work on iOS. The meta viewport tag was working. I think I just had to clear my cache. Anyways, now it is zoomed in too much on the Android Browser, but only on some devices I think. I tried it on my friend's phone and he has Android 2.1 and it shows up ok, but it shows up zoomed in too much on the emulator using 2.1 and my phone which is 1.5. Any idea of why the inconsistencies? My meta-viewport tag is: <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width" /> My link is: http://itphosting1.com/dtang/jarritos/Thanks!
  24. I created a mobile web site that uses Google Maps. However, the font-size of everything on the map is way too small for a mobile device. Is there any way to increase it?I already tried using webkit's proprietary text size adjust property and it didn't work. -webkit-text-size-adjust:200%; Setting the zoom really high doesn't help either.Any ideas?
×
×
  • Create New...