free blog   apache   shopping directory   php powered
hypnosisyuor brain is thin
K1ng\ok i think i know why
K1ng\its not problem with that
K1ng\but problem is  $('#outputList').prepend(prepare(json[i]));
K1ng\its works but just not showing in IE
DukeDrakeI've seen a website on which my scrollwheel acts horizontally
DukeDrakehow can I do that?
r0nyhi,is it possible to load a function after the page is fully loaded?
r0nyit triggers even when i load the page
temp01it does not trigger while the page is loading
r0nywindow.onload = function () { alert("It's loaded!") }
r0nythis is what i did
r0nyand it shown the alert box even before loading all contents in the page
temp01i have a feeling you did    window.onload = myFunction()
r0nyyou mean the exact word *function*
r0nyoh man,may be i did hat wrong
r0nylemme try again
temp01window.onload = myFunction();  will run the function without waiting for onload
temp01window.onload = myFunction;  will run the function after the page has loaded
r0nytemp01: i just tried
r0nywindow.onload = function () { alert("It's loaded!") }
r0nyit just loaded before the page is fully loaded
temp01what stuff do you have on page?
temp01are you loading things using ajax?
r0nyyes exactly
r0nyan ajax function is called at onload on body
temp01onload doesn't wait for ajax requests to finish
r0nyoh i see
r0nythats a very good point
r0nyany work around?
r0nyactually i need to execute a function after the page us competely loaded
temp01use the ajax event handlers
r0nylet me google
r0nydocument.onreadystatechange=function1; function function1 () { alert(document.readyState);
temp01use that where you make the xhr request. see some examples.
sjokkisi've got a function here that expects a mainloop as input. how the heck does that work?
sjokkiscan i just store"") to a variable?
sjokkisand send it around?
Servercrashhi how can i convert a string to title case ?
Servercrashany built in fucntion to do so ?
hello_warudoIf I have a string x, can I go, for (i, j in enumerate(x)){}
hello_warudoI know python
hello_warudoor I have to go int index = 0; for (i in x){++index; blah}
AdamWestonServercrash:I don't think so but it should be pretty heasy if you make o hash of lower and uppers, and then use a regex to replace each initial letter
AdamWestonhello_warudo... are you trying to loop through the characters?
hello_warudoAre strings are mutable in javascript?
AdamWestonno they arent mutable
AdamWestonfor(i=0; i < x.length;i++){/*do something for each letter x[i]*/}
hello_warudoIn Java they aren't mutable either right?
AdamWestonno idea
AdamWestonmy loop there may need a -1 or +1 in the comparison
AdamWestoni always get confused about that
temp01don't use x[i] to access individual chars. use x.charAt(i)
AdamWestonmy bad
hello_warudoI'm making a transliterator
hello_warudoso I'll just copy the string char by char and if it's a char I want changed, copy the changed char
hello_warudothen at the end set the original string as the copy
hello_warudoappending to a string is O(1) I hope
hello_warudowait it's O(n) isn't it
hello_warudobecause strings aren't mutable....
hello_warudowhen you modify an array, does it make a new array?
hello_warudoare arrays mutable?
hello_warudoyes mutbale
hello_warudoI'm trying not to do this in totally ineffecient way
hello_warudodoes charAt return a string?
hello_warudoor a "char" like in C
hello_warudoeven though it's only length one
temp01there's no special char type in js
temp01all strings are strings
temp01you could also just try it and see
temp01js> typeof "abc".charAt(0)
gbot2temp01: "string"
hello_warudoUncaught SyntaxError: Unexpected token ILLEGAL
temp01output/error-messages are useless without the related code
hello_warudocan I put newlines in the definition of an associative array
hello_warudolike var blah = {a: "blah
hello_warudo, b: "as"};
temp01it's called an object in js and
temp01<temp01> you could also just try it and see
temp01keep the firebug/safari console and try things out
hello_warudotranlit.js:1 refers to the first or second line?
hello_warudoline 1 is 0 right?
temp01first line
temp01click it and it will take you to the line number
hello_warudoi had x = blah
hello_warudoit should be var x = blah
hello_warudoI'm used to python
temp01without var, the variable would become global which is bad
temp01so yes, always use var
hello_warudovar x=document.getElementsByTagName("html");
nor3what is "shadowing arguments"? google closure compiler is complaining that i'm shadowing an argument here: JSC_VAR_ARGUMENTS_SHADOWED_ERROR: Shadowing "arguments" is not allowed at line 105 character 37 /// = function (path, arguments, options) {
nor3oh great
nor3arguments is reserved
nor3did not know that.. okay thanks
hello_warudotemp01 um I click it and it doesn't show the file
hello_warudoI'm using google chrome
temp01hello_warudo: click resources tab and make sure it's enabled
hello_warudoI think it didn't load
hello_warudobecause of a syntax error
hello_warudowhat the hell
oxiWhat's good practice for a function of a class that returns a boolean, if you're not sure if the information is available?:
hello_warudocan I have keys that are non english in an associative array
oxiu = new user(); ... u.hasIncommingMessage(); -> bool: true/false
oxibut hasIncommingMessage() might fail, depending on if the information is available in u.
hello_warudowhat the fail
hello_warudoit works when I type in into the debugger
hello_warudobut fails when I load it in chrome
temp01check the file encoding
hello_warudofile encoding is unicode
hello_warudocan chrome load unicode extensions
temp01what's the error?
hello_warudoUncaught SyntaxError: Unexpected token ILLEGAL chrome-extension://aoofgmnmedhdekpoaaiffimolkmbdgpf/translit.js:1
temp01maybe some utf bom thing
hello_warudois UTF-8 better
hello_warudoor Unicode
hello_warudofor file type
temp01whatever works
hello_warudoit works now
hello_warudoUnicode doesn't work
hello_warudoUTF-8 dpes
hello_warudoit works
hello_warudobut mangles the page
K1ng\can someone take a look? live: the script:
K1ng\'fbpic' is undefined in ie
darksidercan anyone recommend any good JS books?
darksiderones that are good for learning with - start to finish - and ones for reference to functions?
darksiderlike i have a "Perl For Dummies" book that has a function index in the back with a list of like 1000 useful functions
darksideri know a little JS - enough to get by, and enough that i can learn more quite easily, but i would like to have a great knowledge on it as i am taking up on learning CSS as well... tryiong to learn how to combine into some DHTML
K1ng\darksider, google is your best friend
r0nydarksider: dont follow any books
r0nyjust get some code from interweb
r0nyexecute it if(errors) fi9x it
darksideryeah thats always good- but i like the way my book shelf looks
darksiderwith like 35+ programming books
r0nymay be a waste of time
darksidernot to mention i stay in the scottish countryside- so the internet goes down on occassion, and goes slow quite regularly
jsBoteloquent: Eloquent JavaScript is a comprehensive introductory Web-based book with examples and a built-in interpreter.
temp01`rhino book
jsBotrhino book: The 'Rhino Book' is "Javascript: The Definitive Guide" from O'Reilly.
darksidernice. thanks man
K1ng\can i do 2 return?
K1ng\                          return fbname;
K1ng\                          return fbpic;
K1ng\in a function?
temp03return an array
r0nythats cool
r0nyan explode it
oxihow do you guys deal with BO's (Business Objects) in AJAX applications?
sjokkishey. when i import a module (like Dbus = imports.dbus), how can i see what properties, functions etc are in that module?
oxiofcourse most of the stuff can be done by rpc, ... but it's useful to have some objects in the browser, like a "User" object for example
oxinow you can't rely on new User(), if the data must be fetched from the server, which should be done asynchronously
oxiI wonder if you find this practice good or bad?: rely on a Event: User.on('isLoaded.... function: (user){ s = user.getName(); ....
oximeaning, that the BO's fields are set asynchronously and you continue the relying logic when the BO's "isLoaded" event occurs
zomgoxi: what else could you do than that?
oxizomg: good question
Wes-FWIW, you *can* do synchronous XHR
oxizomg: I thought there might be a nice remoting framework that does a lot of the plumbing automagically
Wes-Not that I think it's usually good idea
oxiWes: yes, you can, but I also think it's a bad idea
zomgoxi: well, if your objects would mostly be storing data and used for displaying it, you could pretty much just throw JSON at it
zomgbut if they would have some sort of business logic as well then it probably won't be that simple
zomgeg. you'd need to process the JSON into the correct object types
oxizomg: right, I was targeting later
oxizomg: exactly..... and I thought of populating the objects fields in their constructor and have some kind of isready or isloaded event
oxizomg: later I might refactor that into some kind of factory pattern
oxihowever, i'm not so sure how I should handle state changes and syncing to the backend
oxiimho it's not practicably to have some kind of lazy load pattern?
zomgWell I've worked on some apps which had server-side data that needed to be reflected on the client and dynamically updated both ways
zomgbasically it just had this sort of an event thing which would notify the app when data was changed and it would change the objects
oxilike: user.getName(); -> if(user.Name == undfefined) { ... XHR ... user.setName( ... return}
valiohi, can you recommend me some tutorial for javascript object model
oxithat would cause the logic to halt when a field is not arleady cached
oxizomg: ok, great, thanks for sharing
Popular searches: missing   udev runlevel wodim   rewb0rn facebook   dry run slackpkg   monitor rtl8191SEVA2   

Generated by 2.1mg by Jeff Waugh - return