hi im experiencing an extrange behaviour with a call to an external file with JavaScript code i have to load two
I found that document online, but how can i integrate these changes into my application: http://groups.google.com/group/Google-Maps-API/browse_thread/thread/b74bad232d8d2e28?hl=en ?
hey if I have a number that has a decimal point in it… is there a method to chop the decimal point and everything to the right of it off?
How can Reddit be so fast with Ajax?! Digg has a clear delay every time you dig/bury something, while Reddit just instantly switches colors and apparently registers this change. How can this be?
sure that its already saved?
a guess: because the colorswitching is done purely at clientside (everything preloaded) and the "saving" of the setting is done via AJAX in the background
Well… um…
I… guess.
Then Digg and all other sites must be very badly coded.
Well, in Digg's case it's obvious
very badly coded?
Yes.
var x=document.createElement()… var y=x; - is Y a copy of X?
Since you "feel" the delay.
if Reddit changes colour immediately before waiting for a response from the server to confirm that the change has been made then I'd say Reddit's not too hot
no
in all browsers? are you sure?
yes
hello
uh
when i do this
http://pastebin.com/m2ffd5c08
the select field has two rows, first says Fist and second is empty
why is there a empty row O_o
Can anyone help me on a little row visibility thing? I simplified everything to the simplest way that is possible. Just view the page in FireFox and click on 'Merk 1', and see what happens. http://www.q13.nl/libohorloges/
its an issue @ opera xD
nevermind, fixed
Firefox seemed to like display = "" more than display="block"
'mornin
hello
?
looks ok
hmm, for some reasons I don't have the alert though
, is it possible to change this var from within the body?
Like onclick
you can't define a var inside the head tag, js is not that tightly coupled to the DOM
it will become a global variable if it's at the root of a script file
is in the head of the document
does that make it global?
it doesn't matter where you put the script tag
So how do I make it global?
in the root of script file?
How do you mean?
var foo = bar; outside of any function, or omit the var prefix (in which case you can do it inside a function body as well)
hmmmm
because my var is defined outside of the function[s]
so i just hafta remove the var!
Not working, hmmm
Raevel, I defined num = 0; outside of the funtion and when I click it is not changing
Raevel, does this look right:? onclick="javascript: num = 2;"
level9wiz don't put "javascript:" inside events
I just noticed that on google lol
Hmmmm
still not working
Not getting any js errors from the browser tho. js is on and working on other componenets
Hi. Is there a simple way to catch the event of clicking on a checkbox?
Raevel, onclick="num=2" ? That should work right?
is there a difference between an object with numerical properties and an array with a sparsely populated index?
(are numerical properties even legal?)
an array has the array prototype associated with it
`js watch
and the ahref is overriding it
and, properties are always toString:ed
var obj = { 13 : "return", 9 : "tab", etc }; alert( obj[ charcode ] ); ?
looks fine
no, illegal! you go to jail!
if not, then use an array
it's legal
mutilator - i ask because my coworkers tend to clone my code a lot, so if it learn later that I did something that isn't quite right, i've institutionalized bad code practice
heh
i know, cloning code is already bad practice
a= {1 : 23}; a[1]; is fine, at least in the 'shell' bookmarklet
i'd use an object for that, since the property names are of significance
Anyway to make the onclick event override the ahref? I need the href for rel="ajaxtab" but i want to use onclick to handel some functions
a href="" onclick="fCall(); return false;"
Raevel - that's what I was thinking, just wanted to check
does anybody know if the [object].watch works in IE6?
it doesn't
thanks
frames.parent[0].location.substr(0,20) -doesn't work?
when i console.log the "frames.parent[0].location" i get http://www…../main_content.php href=http://……main_content.php
frames.parent[0].location.toString returns "toString"
I want to check whether a url of a frame is as expected
.location.href
ah
yes was about to say .href etc don't return a value
thank you
hey, i have a simple form (name:, function:, submit..)
i would like to add a "Add another user" button
so that JS print another form with a specified id
toste - do you really want another form, or another input inside the current form?
another input
hello, can I add a method to a DOM tag, as I 'd do, for example, for a string string.prototype.myfunction = fucntion() ?
I tried form.prototype… (for the from element!) but get an error: form is not defined :/
section?
I have to do an alert from inside the page, and that's an included php file, so i cannot modify head
what's the javascript function to scroll to an anchor?
you'll have to find y coordinate for target anchor
then, use window.scrollBy(0,anchorY);
are you freakin serious?
you can't do window.location or something?
"wnix" at 71.6.194.243 pasted "function to find Y coordinate from object" (16 lines) at http://erxz.com/pb/4126
no, it should work in the body too. But if you want access to a DOM element in this script, the script should add after this element to the body.
nvm, prototype has scrollTo
woot
or use eg. an event handler window.onload = function() {….your script… }
hi! can someone give me a hint on how to catch a key event (like keypress/keydown) in a certain svg object?
Hi all. How can I use the value of a variable in a regular expression in javascript? var x = 'taco'; othervar.match(/x/); clearly won't work
new RegExp (x);
big thanks leobm
I think I understand. thanks.
hey, a quick question, can javascript access contents on a CD?
no
not from a browser.
hm.. thanks
unfortunate..
any idea how i can load information from a cd like a file with records and display it in a browser?
in jquery?
like let's say my site normally retrieves data from a mysql database, but if i were to bring a laptop to somewhere with no internet access, i would like to be able to get some of the information into a CD and brining it around and still be able to do presentations using information from the CD.
is that possble at all?
$("#id").text() and $("#id").value and $("#id").html() does not work
Oops sorry - wrong channel
an alternative could be a signed applet.
or webstart application.
search in google for the keywords 'java webstart" or "java signed applet"
hmm, but that means i would need to code a bit in java..
alright, thanks for the ideas leobm, i'll be to reconsider my options
s/be/have
Im having problems with array.forEach-command, it does not seem to step through all items in my array but rather a random amount of them. Has anyone played around with this?
can you reproduce it?
yes
http://java-avm.sourceforge.net/
thanks leobm
java 1.6 has a javascript engine included. you can code javascript and can use java classes. look at
"Scripting for the java host Platform" google
Im using forEach because I do not add items sequentially but at scattered indexes, so I need to loop through the array and get the index where each item is located at.
leobm, thanks for the advice and help
the fact that you're using an array probably messes that up
use a regular object instead
how do you mean?
I have been thinking of using Hash instead, but a regular object is a new one
an array represents a list, if you scatter the indexes it's not a list, it turns into a dictionary
how do I check if a variable is declared?
typeof theVar !== "undefined"
ah cool ty
"raar" is not an english word
raar is undefined
I didn't know how to check before
'document.all.whatever.style' is null or not an object" - what am I doing wrong; http://www.french-property.com/scripts/tom/edit_mails.php ?
firefox works fine with document.layers
you should use neither of the two
hi
oh? what should I use instead?
it depends on what you are doing, but document.getElementById is one alternative
I'll give it a shot, ty
(typeof x!==undefinedl)
ups
I made an web application based on Chameleon GIS environment, my problem is that I want to make floating window which contains the keymap. I already made most of that part I can move the keymap layers into the floating div, but if I try to marquee the div that contains the keymap away from
the original position it loses the framing functionality
I mean I can't mark a part of keymap to be displayed on the main Map, except if I move back the floating div to the original position again
Does anyone have any ideas about why http://httux.htgm.no/statviewer/ just refreshes once and then stops in IE? The JS is http://httux.htgm.no/statviewer/statviewer.js (jquery)
hi, is there any way to get the document height? (not window height)
the main problem that the Chameleon make such stupid implementation of this part it just work with document.write, when it creates the keymap layers it scatters them all over the document
script language" (25 lines) at http://erxz.com/pb/4128
http://erxz.com/pb/paste so uh
ehr
http://erxz.com/pb/4128 why does this have results like x: 1.9000000000000015 // y: 0.7900000000000005 O_o
so I'm looking through google's map code
look what I found…
if ("GMapEZ" in classes) { … }
lol
Here we are checking if a property named "GMapEZ" is present in the object "classes".
ya I get it, its kind of clever. I didn't know you could use the 'in' inside an if statemen
t
Probably because of the internal storage format for floating-point numbers.
oh boy…
i so hate computers xD
lol, this is funny
alert(["Your browser is not capable of displaying", "Google Maps on this page. Try using Firefox:", "http://getfirefox.com/"].join("\n"));
they're not a fan of just using \n in their strings eh?
such overkill
Search for the article "What every computer scientist should know about floating-point". It's floating (pardon the pun) around somewhere on the 'Net.
That article is kind of intimidating for beginners…
That's life.
Wikipedia explains the same thing is a bit simpler terms.
document.write("" + "script src=\"" + src + "\"" + " type=\"text/javascript\"" + "/script");
why did they split the from the script?
Probably because they were worried the browser will parse it as a new opening tag and they didn't properly comprehend the concept of inline JavaScript.
:/
hm.. yes.. older browsers.. right
seems like excessive paranoia, but it can't be that bad
so
It is stupid.
what happened to the "the computer only does what you tell it"?
I'm really laughing at google's alert box
that wouldnt be true in this case
O_o
alert(["Your browser is not capable of displaying", "Google Maps on this page. Try using Firefox:", "http://getfirefox.com/"].join("\n"));
the same *exact* thing could just be
All you have to do is use DOM methods, or if you insist on living in 1995, say <script instead of script.
alert("Your browser is not capable of displaying\nGoogle Maps on this page. Try using Firefoxnhttp://getfirefox.com/");
but I bet the guy who made it got excited when he learned what join could do
and wanted to use it
what happened to the "the computer only does what you tell it"?
# what are you talking about?
LMAO.
Does anyone know if it's possible to unit test Ajax?
…and if so.. what framework is good for such a task…
hi
how can I check the domain the user is navigating to on unload?
I doubt you can. Atleast I hope you can't
how can one check if a value is undefined?
yeah, i was doubting it too.. I was telling a coworker it would probably be a security risk if you could
myVar === undefined
or
it would be possible to examine where they are going, see that they are leaving, and say "HEY! GET YOUR ASS BACK HERE!" and force them back :L(
thanks, wnix
typeof myVar === "undefined"
the first example did not work
alright
thanks
myVar === undefined works, as long as myVar has been declared
myVar === undefined
Error: Error: ReferenceError: myVar is not defined at line 0: (null)
var myVar; myVar === undefined
true
function f(myVar) { return myVar === undefined; } f();
true
var obj = {}; obj.myProperty === undefined
true
typeof(something) == 'undefined';
true
that kind of defeats the purpose mostly
but thanks for playing.
"kind of defeats the purpose mostly"?
mostly
document.myForm.array[0].value, where array is an array of strings and contains the names of the form's elements (to put it in a loop)?
depends what your purpose is mostly
because I'm not declaring the variables
so it wouldn't help me
but the other one does
why not?
it's cool
you can still test for them as properties of the global object
yeah, the other example works fine
this.myVar === undefined
true
document.myForm.array[0].value = "someValue"
no
"array" is not connected to the DOM.. right?
not directly.
myFormElement.elements[inputName].value = someValue;
deltab, hum.. I'll try that
you shouldn't use document.myForm, by the way
use either document.forms.myForm (or document.forms['myForm']), or document.getElementById('myForm')
I represented those above by myFormElement
ie6 seems to be having problems dealing with inserting a row into a table using javascript
or is this a programming error on my behalf
deltab, what is myFormElement? the name of the form?
depends on how you are inserting the row probably
no, the form element
as obtained through document.forms.myForm (or document.forms['myForm']), or document.getElementById('myForm')
or the form property of an input
new Insertion.bottom("tblid",…)
try using the table's tBodies[0] instead
it looks like it checks for insertion into tbody and tr, but not the table
is there a cross browser compatible function to check pageYOffset?
you can't read CSS values if they have not been set with JS before"
is this true?
pageYOffset — what's that supposed to measure again?
what part of the page is visible
like when scrolling
so… the just the window height?
because that's not what Mozilla says
"Gets the amount of top page content that has been hidden by scrolling down."
ok well im looking for a cross browser version of that
this? http://msdn2.microsoft.com/en-us/library/ms534618.aspx
Agamemnus does scrollTop apply to the scrollbar on the browser as well?
hello~
i don't know and the page isn't opening anymore
hello
hi!
what's up?
hi, getting started with Javascript - I can put a style property for a div in a var, but how to show the current value when viewing the page containing the div?
some simple plugin for Firefox maybe?
Does anyone know if it's possible to unit test Ajax?
attachment_array = attachments.split(/,/,attachments); — for some reason attachment_array is not an array, hmm how can i makeit an array ?
so… is it all just people comeing here to seek help without anyone helping? ^^;;
..and if so.. what framework is good for such a task…
that's right, Princess^^.
coppershade-org^…
you can't read CSS values if they have not been set with JS before"
"unit test Ajax"?
Uh.. yeah. Does that sound right?
no, it doesn't.
what are you talking about?
hi… does somebody knows how can i discover when a window is minimized and when it isn't?
I guess I should say "integration test" but without opening/closing the browser eeach time
*each
ok so I'll ask the question I am here for… =P
Selenium is too heavy for my purposes
BARBA_RUIVA, might be a bit difficult
so basically I am using javascript to do an animation and I want the page to go to another page at the end of it
but I don't want to use like window.location.href = newpage or something
BARBA_RUIVA, look at the screen.height / screen.width values, the browser's natural height and width window, and the current window size.
cuz that kills the back history -.-
window.location.replace("http://google.com"); - the history remains unchanged
how can i populate an array from str.split(/,/) ?
does it?
hmm
let me try
Princess^^: yes ma'am, that's the poitn of the function
Princess^^: compatbility is questionable
Agamemnus, i will try
var ary = str.split(/,/);
i tried with window.onblur… but is not exactly i need
Agamemnus, thanks!
DDustin, thxs
Can the var top be used as a global variable for iframes/anything within a single browser window?
iframe communication is tricky, google it
also, firefox recently released a patch to "fix" an iframe "exploit". FF 2.0.something might make it impossible now
My company uses iframes in their product, which is IE only, and I wish their was an easy way to just declar some js library once and all "child" frames/whatever will have access to it
nopes thanks for the suggestion tho
think Ialready tried that one before too
window.location.href = nextpage works for firefox but not safari -.-
on safari it kills the history
who cares about safari
errr…
how does it kill the history?
you mean the spanish iphones? -.-
otherwise I wouldn't care
look at the mac history
if it's something other than "undefined", maybe you'll see how to fix it
well, safari history
also, is it safari 3?
someone earlier mentioned buggy javascript in that
any of you familiar with the safari, back button, iframe ordeal?
enlighten us
does anybody know a way to move an iframe inside the domtree and prevent a reload of the frames contents? insertBefore does moving, but the framecontents reload.. ?
Agamemnus:safari 3, the history looks right just the back function that won't work right
safari doesn't add iframe pages to history
also doesn't add #hashes
http://bin.cakephp.org/view/1738437074
anyone can check whats rong in there ?
http://www.streampad.com/blog/?p=110
hi!i have a definition of document.getElementById(idSTR).style.backgroundColor = '#FFFF99'; in firefox it works, i get to see the background color butt in Internet Explorer it doesn't show
is it diferent the sintax?
oh well thnx guys… I'll figure something out
I have a question about IE6
tavares, no, I don't think so. probably you did something funky with the id
in IE6, on the first reload, sometimes images don't look right (too big in height/width etc.)
and then on the second reload everything is fixed
does anyone know how I could fix this?
press reload?
…
thank you, i'm here all week
but I want the images to look right all the time
i don't know why this is happening
because webprogramming sux
…
seriously it does
nuthing comes out right
Agamemnus:
nor cross compatable
Princess^^: yes I double checked and window.location.replace does just that
try reload like that:
window.location.href=window.location.href;
safari is a browser that is lacking, I doubt it will allow you to move w/o modifying history
lol
if you have server acess you could do a 403 redirect or whatever the number is
wnix, no
Princess^^: yes that's the correct way to do it, if you have control over the server
I don't want to reload my page infinitely, or even at all
I think it's because the height and width attributes somehow get distorted..
I had this problem before too
iwas the "#" before the code of the color it as to be without it…
tavares, what?
tavares, oh.
idk
i'm just a noob
window.location.reload(true);
try preloading the images?
I don't think it helps
..oO ( is my question that unclear or the domtree too tricky ) ..
but how do I preload an image anyway?
rnix, idk.. i don't use iframes =\
wnix, but wouldn't the reload the page?!?
hmm well when I do window.location.href = nextpage; at the start of my function and comment out all my animations it works… must be an issue with my timers somehow
here is my code for preloading:
function cacheimage(curimage) {var preload_hoverimage = new Image(); preload_hoverimage.src = curimage}
the issue is tho then it requires 2 hits of the back button instead of one.. which I could live with
It don't work Agamemnus
what the heck
wnix, rnix?
hmm, sorry. hover images with javascript? did i missed something?
no hack, i'm another
rnix, what?
rnix, what hover images?
I just pasted my image host preload code and I was asking whether it's correct
just because you types preload_hoverimage in your example code
var myImages = []; function cacheimage(curimage) { var preload_hoverimage = new Image(); myImages.push(preload_hoverimage); preload_hoverimage.src = curimage; }
oh yeah I was doing something else with that code earlier and forgot to rename it
now works
is it not possible to just define your hover functionality with css?
… wrong hover.
ah
wnix, that just loads them all into an array. i'll try..
yeah
ah global array
in your version, when function ends, the variable with image will be deleted
i know, but doesn't that still load the image into the browser cache?
hummmm
I think so
=/
maybe it is some other problem
it's pretty rare
do you use IE6, wnix?
IE7 too
my IE6 is standalone
can you look at my site and waste some bandwidth clicking the links?
and then tell me if anything gets distorted
maybe it is just an IE6 issue
http://www.flyingsoft.phatcode.net/flowers/index.htm if you want..
yeah… bugged
when click in any item of menu
var id = document.getElementById('id').value;
that will give an array with of id='value' ?
or will check for id='id' ?
get the value at element and place in variable id
what happens when you click?
you mean images distorted or something else?
uh
Agamemnus, i have tried without results here… do you know some example in the web?
i dont understand exactly you means when you say to check window screen
Hello all, I'm having a strange problem with Firefox where I have a frameset, and I use onload in the frameset, yet the child frames have not completely loaded… I thought they were supposed to be completely loaded before load triggered ?
images distorted
http://bin.cakephp.org/view/699064378
the remove function does not work
wnix, any idea ?
Agamemnus, sry was away, sure you can. Angus PNGfix reads CSS properties.
I know it was ace_noone who said it (before I joined probably) but you gave it to me
coppershade-org^, I thought you had a problem with the same thing earlier?
anyway, thanks I will look at that later.. I changed my div to be made in javascript code instead already, though
is to possible to use multiple statements in a case switch? for example: switch( i ) { Case 1, 2: alert("ok") }
ron_asheton, yes
case 1:
case 2:
alert('foo'); break;
or you can do this:
switch(true) { Case ((i==1) || (i==2)): alert("ok") }
can somebody point me in the right direction for controlling an embedded quicktime movie with javascript?
document.getElementById("movie").stop(); isn't cutting it
got it
http://developer.apple.com/documentation/QuickTime/Conceptual/QTScripting_JavaScript/bQTScripting_JavaScri_Document/chapter_1000_section_5.html
err
how do I get the text width of a ?
Agamemnus, I meant that
meant that?
meant what?
Agamemnus, Case ((i==1) || (i==2)), this kind of syntax. thank you
oh, ok.
sure.
You know all those sites which let you choose a country and then it shows a list of cities or "sub areas"? How do you get this information? Is there a global database?
obviously they have the money to hire monkeys to find out
you can try mining wikipedia
"Information age" indeed…
Sadly, the information is mostly crap.
mostly
What do you mean by "mining Wikipedia"?
does anyone know how to get the text width of a element or even to center it…
You do that with CSS.
text-align: center;
with javascript
center on a div
you can download the appropriate files from wikipedia using your own program or javascript
you can extract the cities from the files
What files would that be?
or maybe google has something
What articles are you talking about?
http://en.wikipedia.org/wiki/Cities
List of cities by country
List of cities by latitude
List of metropolitan areas by population
etc..
I wonder how reliable that is…
Or even how complete it is.
http://en.wikipedia.org/wiki/List_of_cities_in_Afghanistan
as reliable and as complete as you can hope for.
55°43'N 12°34'E Copenhagen Denmark
there is a .mil site with a similar list, though probably not the ancient times and middle ages stuff
zhttp://www.infoplease.com/almanacs.html
http://www.infoplease.com/ipa/A0001796.html
is it possible to load google maps on an ajax loaded page? i want to init the load() function inside the ajax page
is there a window.close() that works in FF?
zombor, sure, why not… try iframes?
migs, isn't that a security risk?
iframe?
cant use that
not in this case
sure, but that's probably why you can't find it in mozilla
so it's IE-only?
im trying to load google maps inside a jqmodal dialog box with custom php host variables
maybe you can find another way
did you look in mozilla's developer-mozilla.org thing?
I guess it's okay if it's IE only
zombor, idk
hmmm
any body know about using Javascript with Chameleon GIS Environment
??
the ajax doesnt load with all the google scripts in there, but it will load without ajax
I doubt there's a way to automatically log out the user after they hit the close button, is there?
or is that just a retarded question?
nm, it's a retarded question
yes
pretty retarded… try onunload?
ppl, i have no idea what the ajax is so….
zombor, ppl*
im using jquery
http://kenoshaareachamber.imagemanagement.com/member_directory.html
add it to the button's onlcik event
tells me nothing cause I never used it
close button in the browser.
how do I force a variable to be type string?
ron_asheton:
so I missed something : )
somestring = ""
what do you mean by "what the ajax is"?
Agamemnus, I mean some method like parseInt( variable );
^migs^, you can use cookies if the user wants to log in again and use a cron script to monitor last-known-activity-time
idk, ron
zombor, well… Idk. IDKKKKKKKKKKKKKKK
ok
lol
use an iframe
if you're somehow inserting the google script in, look at namespace conflicts maybe
i cant use an iframe
like i said
use ajax
i am using ajax
everyone should use ajax
thats my problem
if the page you're trying to load uses javascript you'll have to manually parse and eval it tho
What is the syntax for making a new Object that is basically an array (as I'd like to add my own functions) ?
or if there is a lib that does that, tell me!
in the ajax loaded page
that might work
amf, somearray = new Array()
it doesnt work
i get an error back from jquery
and then add to it by doing somearray[0] = 1; somearray[1] = 2;, etc.
I could set up a cron script on their computer that monitors the cookies. If the cookie says it's okay to log out, then it logs out
I wrote a function which loads a page with ajax, parses the script tags and eveals them (when its a src=".." script tag, pull in the file with ajax first and eval the content)
^migs^, nono you got it backwards
^migs^, save their login stuff to a cookie and use the cookie data to automatically log them in if they want to log in again
myeah, a friend had the exact same problem, even with the js parsing and evalling it wouldn't work
)
^migs^, then use a cron script to track their last login date and use a timeout value to check whether they're still logged in
=(
I think he means his own namespace, as in
var awesome = { cool_alert : function(a) { alert(a); } };
awesome.cool_alert("blah");
cron script on the server
right amf?
of course the first part is not what you asked, but it would help
so i cant have javascript in a page loaded with ajax
the matter would be clarified if we knew why you want to log out the user if he closes a window and how "logging out" proceeds
you can, but the simple ajax scripts you find on the net won't evaluate the js contained in the page you load
function NewArray() { this.prototype = new Array(); } this is closer to what I want, but wrong
so or extend these scripts or find a library that does
if your script just looks at the IP to test whether the user is logged in, that's different than looking at a cookie that gives the login info constantly
amf….. what did you want again?
"What is the syntax for making a new Object that is basically an array (as I'd like to add my own functions) ?"
hmmmm
ok, amf, try this..
I guess var NewArray = Array(); then NewArray.prototype.somefunc = function () { } makes more sense than what I just said
hmm, where it it…
maybe this is what you need?
http://www.w3schools.com/js/js_objects.asp
or you already know this?
I thought I wanted to extend Array(), but I just want my object to have the interface of an array but do different things for push(), pop() etc
is JScript.NET still based on ECMAScript? I can't get some features to work
hello collink
omg!
Do the thing i described
you can build your own namespace, so you can do methods such as .pop .push
you schoolin' nubs in here?
box is dropped down? this.offsetHeight doesn't change?
in my off time
LOL
s/\?$/\./;
seemed like you were helping someone just now
so you can var blah { = { custom_push: function(a, b) { alert("pushing "+a+" to "+b); } };
blah.custom_push("foo", "bar");
hows things looking with zeb? still doing work on the drift website?
not much
Is there a way I can use javascript host so that when a user clicks a button, it opens and closes their CD drive, makes their computer beep several times, and gives them a BSOD?
^Migs^: tell them to use IE
then just write code as normal.
nice
http://qdb.us/103393
whee
anyone know how to do that 'big pixels getting smaller as the image streams' for graphics-intensive sites?
is it done with some attribute of the img tag, for like lower res pictures?
sure
it's in my huge HTML 4 book
I remember reading it
anyone know of any existing conflicts with effects.js (from scriptaculous) and IE 6 ?
or even better, is it easy to write a script that loads a lores pic and stretches it, blurring it?
image something
and then fades the real pic into focus?
wait…..
I'd do it with the dxtransform thingy, but I don't know if it works on mac?
"Simply save your GIF or PNG images with the "interlaced" option, or your JPEG images with the "progressive" option."
ah
! that's why my images didn't look right (distorted) at the beginning
still a blurred image host that comes into focus would be even nicer
I don't think mozilla does that
coppershade
http://www.codinghorror.com/blog/archives/000468.html
it's basically the same as you said
I need to de-interlace all my images
dammit
hehe
exactly - but does JS have any processing power for fading a pic away on top of another - I mean rendering capabilities?
yeah sure, opacity
coppershade.. if you know photoshop, is there a way for png images not to be automatically named ____ copy.png?
box is dropped down? this.offsetHeight doesn't change.
Agamemnus, ??
alex25nj, test if it is selected?
I save pics as png all the time and I never got that
what version?
are you using ctrl+alt+shift+s?
I have CS2
no
me too
i used the dialog box
if you don't "Save As" but "Save for Web" it should work
I have a special grip for hitting ctrl+alt+shift+s in one go
I've programmed my hand
aight
can't you reprogram keywords?
i don't think you need to program your hand
i like "save for web", saves a few more steps too
how can i print out all the attributes of a variable?
theres some function but i cant remember the name
childNodes?
Test if a drop-down select-box is in a dropped-down state
onfocus or onselect.
I have a tooltip script that appears in the wrong place only when the select box from which it appears (onmouseover) is dropped down. Hiding it onmouseout, onmousemove, and onchange doesn't do it.
idk
does anybody know anything about the readystate attribute of embed objects?
Hi all
Hello
Is there a simple way to get a users computer name ?
no, just their hostname
Hostname meaning there net connections name
there has to be a way to get there physical computer name.. Its all on the itranet
intranet
well, sometimes it might be transfered in the user-agent string
hmm.. Ill take a look at that
msg /listserv
but it's definately not going to be reliable
there is no way to build a realible solution even if i have to ask for users permission in a script to access the system
im not really a scripter I just have the idea
nope
what about using asp? or java?
those are server technologies
nothing to do with a client giving up it's computer name
gotcha…
ill brb
Hi all
hello again, I have a form that I want to submit using AJAX, everything works ok, except that I don't know how to send an array with javascript
Can someone please help me with http://www.alexlibman.com/jstest.html (use firefox). Read explenation therein.
xhr.send(data.makeRequest()+'&attitude='+['salut', 'coucou']);
but it's converted to a string before being sent
array.join (',') ?
Can anyone help me with the best way to implement namespacing?
I have seen two approaches
hey guys, there is a way to know the screen coordinates of an object ? (Relatively to screen)
in the php file ?
yes, sec
Use arrayname.join (sep) in JS, see http://us3.php.net/split for PHP. Make sure the sep string you use cannot appear in data as usual. Don't know if there's a better way, see PHP manual.
this would also work with javascript enabled?
gonna read it anyway
thanks
Alex25NJ ?
sec
Download http://www.alexlibman.com/CieNTi.js let me know if you have questions
what's the simplest way to fill in a form field?
thanks Alex25NJ
how do you mean
i have a form and i want to fill it with "test"
This is relative to browser object, or do you need the entire screen?
just put value="test" for the value attribute
or
with JS
entire screen if is possible Alex25NJ
obj.value = "test";
obj being the input value which could be grabbed it's id with document.getElementById
wow, i just saw a screencast and the dude keep doing function(){…}
for (var i = 0; i document.forms[0].elements.length; ++i) { document.forms[0].elements[i].value = 'test'; }
that is horrible coding
ppl like him should go live with monkeys
do you have a code example?
Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there's no issue with IE). Read explanation therein.
hello, interested in the whole name spacing thing.
Is there a best practice for this?
me too?
does anyone know some good tips on how to get prototype to work well with IE?
IE complains (crashes) when safari & firefox don't
then it's working normally
IE is meant to do that.
IE7 crashes or older version?
Ask the users to use latest version, don't even worry about compatibility with older ones, they're a security risk anyway.
If neccessary to sort of support older IE, you might find it helpful to cut back features
I do this, if I detect that it's ie6, I often cut out certain ajax functionality, effects and such like
IE6 mostly;
that might be the way to go
but I thought prototype mostly behaves
bitwise5, what's giving you problems? anything specific?
ie6 says it's syntax related; "expected :" also "element not defined"
i have a js function, how do i invoke it?
bitwise5 - pastie your code..
see prototype.js (i'm using 1.5.0)
bitwise5, prototype.js behaves well, so my money is that you've got a syntax error. safari and firefox are much more lenient than ie.. Are you using any ie plugins for debugging..
is that your only include? have you isolated it, so there is no other js
not even on the page?
as in no onclicks nothing
this sounds liek aproblem elsewhere I use that version of prototype without probs
yeah, ie6 debugger points to a specific line in each of prototype and scriptaculous;
hello
bitwise5 sounds like soemthing fishy to me. Both those libs are fine. I reckon the error is elsewhere.
need a little help - which properties should I use to change the value of something using javascript in a frameset based page?
I need to update a counter from one frame to another
Are they included in a page with no html other than head body and include js tags
?
i'll have to try that….
i'm guessing they load fine though, the page dies halfway through (well after the includes)…
so you're including only scriptaculous and prototype?
no, i'll try that though; make make a few of the same calls that we do in the other pages
do you have ms script debugger and webdev helper and iedevtoolbar? (sorry if I'm being patronising)
they'llve give you more accurate debugging..
actually, our dev team is on macs so we weren't even test (GASP) ie6 until a few minutes ago
I sometimes get errors in ie which are total bullcrap, and then use webdeve helper and find the real error, whcih is often in another file, or inline (hence me asking you to isolate your scripts)
I'm a mac too
and I did just the same with www.listen2listings.com
yeah, i'm sure the reported error is bs -
went live and then worked out that javsacript in ie has totally different security features and this crappy debugging situation. expect pain for a few hours, my friend
those tool bars will help alot
you can also get firebug for ie
which will let you execute the code snippets live, and that will help you debug
u include it as a javascript on your page.. If you had a page with scriptaculous - prototype and firebug includes
with 1 div
you could try executing some stuff like Effect.Appear('your_div') and shit, to see if it's working (press F12 to display firebug)..
yeah, i was thinking just call everything we use by hand, one by one
that's great advice though, thanks
I suggest build up from that and isolate what IE doesn't like - I guaranttee you've either missed a semicolon, or you're getting an element back from prototype which isn't quite supported in ie. The errors will be bogus, coz of the way protoype uses eval - the problem isn't prototype, so dont;
freak out.. it's something else.
good luck!
thanks!
`icons // Anyone suggest a generic name for icons like these that won't be confused with other uses of that name (ie, 'buttons' is out)
Say it loud, say it proud, say it way too much: http://gtmcknight.com/buttons/validated.php
what's the name of that script that keeps the header and fades in what is below (when you switch page)
Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there's no issue with IE). Read explanation therein.
hi guys, Iam trying to have my text field show available options while typing. any idea? note, iam not a java professional, actually not using it much, but want to use it more in the future
"i am not a java professional" — lesson one: java != javascript
I've heard them referred to as "antipixel" before but that seems to just be named after the blog which popularised them
Yeah, never heard that before .. I'm calling them micro-badges
mmhmmm
widgesigns!
you need to use AJAX for the options.
OK, thanks
thanks
You don't need ajax at all
It's *useful* if you have a great number of options, but it's never *necessary*
;google javascript suggest
and is updated onkeypress
http://www.devarticles.com/c/a/JavaScript/Suggest-As-You-Type/
^^ Alloosh
thank you, I know that the available options are js and ajax, I want to add this as an option to one site iam making and its not so important.
(AJAX is an overused buzzword, I know. But you do need JavaScript.)
(do the same google search for other options)
can I use this to play flv files? var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);
No one is helping me… Can you recommend a good forum I can take this to?
tips for sorting a table?
http://rick.measham.id.au/paste/tableSort.htm
hi im experiencing an extrange behaviour with a call to an external file with JavaScript code, i have to load two files, the first is loaded but the second doesnt, it wont work if i change the order of loading the files, and i have verified the privileges, the extrange thing is that if i change
the file to web's root, it will load nicely.. my tree is /js -where i intend to store the javascript code., can you help me please?
the code im using is script language="JavaScript" src="js/validator.js"/script
If you edit the location URL for your browser to open your .js file instead of .html, does it come up or do you get an error?
no, it gets the file in text mode
The JS code might be dependent for them to be loaded in certain order, or from a certain place (in head vs in body, etc).
thanks, you indirectly help me to find the issue, it was firefox cache, that was preventing me to load it.. ohh i hate this things!!, i lost like two hours trying to solve this!
thanks a lot, excuse me for the n00b
gotta go!, thanks again
lol
I'm in the habit of pressing Ctrl+Shift+R (or Ctrl+F5) to refresh instead of w/o Ctrl - that overrides cache.
damn, saved my png as interleaved, still it won't show while loading
pixelated I mean
how do you make a link on a page be a "back button"
window.history.back()
hrmm.. how do you put that in an anchor tag and make it work.
== eww
help meeeee
Available Plugins: oeis jeval spell cpan shorten rt topic squeeze rbeval acronym change managementspeak reverse join translate bibleit core imdb insult tv help echo eval convert jseval mangle restart quit deparse part pyeval reload_plugins goobooblink heap_test rss
someone help meeeeeeee
hey guys … can someone explain me (if possible) how to fix the delay in the reaction of an IE moving the slide ? (works great on FF). http://www.lachapamecanica.com/nuevo/?seccion=chapastudio
just place the mouse over the slide and it will follow it
but in IE a mouse with sandclock appear and do the slide move slow
and FF does perfect
someone knows how to fix it ?
i'll help you
_IF_.. y
_IF_………….
?
it works
i did the neccesary browser especific things
if you go here http://flyingsoft.phatcode.net/flowers/pictures.htm
and tell me if the images are distorted
taller, yes
goddamn it
i see a left menu, with tall-distorted items
ok, so your problem with IE.
did you just say it works?
yes
try it
it works
but the response time is slower than FF
yeah, i do see an hourglass sometimes
FF works *perfect*
and ie is slow
open it with FF now
How do you get all the methods of an object using introspection in js again?
hmm
for me, ie isn't slow
but it does have an hourglass
are you using ie7?
and I think I might know the problem
" + object[key]);
try replacing 'object' with 'window' for a good time
cienti?
Agamemnus IE6
anyway i had a problem like this before.
tell me please
the little cursor thing is an image?
hum, I've never used console.log actually - mostly alert and div's
is a div background (9×9 px gif)
well then replace console.log with the logging of your choice
I wouldn't do alert, however
yeah i think if you change it to an image it might not be a problem
you'll be sitting there for a while
it's a little tricky because you might break it in mozilla if you fix it in ie6
let's try !
nn all ye brave
i don't exactly remember my solution though but i think it was a div and an image together
" + ok[key]); doesn't give anything though (not a single alertbox even)
I just had a look at the code - i want methods not members
my solution does have a URL, but it's somewhat broken in Mozilla 2.0.0.6 now
what makes you think methods and members are different somehow?
because I'm used to members being variables, methods being functions, the they is used as an arraykey which I guess would retrieve variables but not disclose membernames
"members being variables, methods being functions," yeah most languages are like that. javascript is not
functions are first class variables in javascript
javascript is typeless, a function type is the same as any other type
as george clinton almost said, free your mind and your code will follow
ah right, so it should work then.. strange.
if "loosely typed" is the term, javascript would be the town bicycle on crack
Agamemnus much better .. thanks a lot
" + t1[key]; \n alert(t2);
yes it should
but it doesnt
sure
the date object seems to have no properties, wierd
test it in mozilla too
s/wierd/weird/
if that doesn't work you might want to switch whether it is an image or div background depending on the browser
interesting
What is the best table sorting .js, most compatible and faster ?
sort
its an amazing function
DDustin?
any good IE7 toolbars for debugging and speed loading?
it sorts arrays
but i mean tables
i have a table
Is there some defacto place to look these things up? I keep using searchengines, landing random places. Such a grief compared to some other stuff. I realize there are many companies with their own implementation but..
how to sort it
you don't want to make your own?
welcome to javascript
http://rick.measham.id.au/paste/tableSort.htm
(like in my case, the api for the Date class)
probably no
tsb I usulaly use mdc
usually *.. it seems to be the best
for most things
can you believe I've been doing web-stuff for years? for some reason I shun sjavascript.. a lack of any good reference might be part of the reason.
right, thanks.
thanks Woosta
most web devs do
that's the reason I'm making my MMO javascript game
ahah
good grief!
ya. its actually mostly done
WOW Woosta it ownz
:P
Woosta can i use script in body instead of head?
its a php cms
but its to hopefully help prove to everyone that javascript isn't something to be afraid of
so i dont feel like including it in all
I do that all the time
and would suck to check if it has to load the script or not
It's JS, you can do whatever you want with it
DDustin it validates still right?
Anyone knows a little about Ext Js and can help me (although I'm pretty sure it's something I'm missing with javascript)
Woosta love you
I stopped caring about validation years ago
i dont, since i get paid for it
I know, it's a much easier language then what I usually use, it's just that is is so wildly inconsistent across browsers and poorly documented and whatnot that it just turns me off. There are plenty of offline-implementations of ecmascript as well
ya cross browser is annoying
but yes validation sux
for hobby projects my rule is I only port to browsers that have proper debuggers
and async javascript didn't exacly make things better
it make for cool possibilities, but compared to sockets and other things it is a nightmare to debug, atleast that's my experience with it
is the game still behind closed dmz's or have you published a beta?
uh ya its public, hold on
Can someone please help me with http://www.alexlibman.com/jstest.html (use Firefox, there's no issue with IE). Read explanation therein.
what was your original question? just looking for docs on Date object?
it was about introspection, I had done it several times before, but had forgotten it I looked Date up on mdc
nfi why js thinks nothing is "in" Date in a for loop
yeah it is public, it looks like I broke it though
instead of doing this manually, are there any editors with intellisense or whatever? I'm sure vim has some omni support for it, but the short description would be good to get as well
let me fix that
Dojo 0.9 is out woo!
http://wipproject.zapto.org/tmp/start.html
I'm guessing konqueror isn't supported?
no sir
works better than opera though
actually, is there supposed to be more than characters there?
as many characters as there are people viewing the page
right
the left control button fires
are you zues?
yeah. it actually seem to work in konq, except for ctrl
here I'll fire a bullet at you and kill you
(but that's because ctrl in konq is an accessibility key which highlights links)
hey … in php you can do a negative comparison just writing ! before ( if(!$var) …) … in JS there is a way to do that ?
hehe neat.. this reminds me of my first allegro efforts
that's funny, you've used allegro?
this script is intended for allegro.cc
if you change direction midair you have to click twice to jump once
haha!
yeah, allegro and then sdl
years ago..
oh
maybe I got it :p
and then sdl/opengl, which is fun but getting graphics for anything but a spaceshooter seemed impossible so it's been a while..
and then sdl/opengl, which is fun but getting graphics for anything but a spaceshooter seemed impossible so it's been a while..
Night all
What's the one-line "if/else" statement look like again (or what is it called?)
omg
i'm running into that problem
there Agamemnus?
what
what do you want
that print issue
http://www.icegn.net/test.html
clic print, print/close are suppose to dissapear
but focus goes back to the window and it redisplays it
the ternary operation, condition ? c1 : c2
thank you SO much!
and it was working fine earlier?
yea, remember, ya tested it
except the code was different
but with style.display=''?
right
remember i had both ways on the screen
resize and style.dispaly
yeah but then we figured out a way to use style.display
but theres something with the html on that specific page that makes it not work
right?
it did work with style.display, right?
with a timer.
you didn't implement it? :/
because a timer doesnt matter
the focus goes back to the page
i could redisplay on a timer, but theres no guarantee when they click print so it could print the buttons
because you need to change your onclick
that's not what I mean
instead of onclick="printWindow(0);"
onclick="start_timer()"
the timer should hide the button then start a 1 second timer that activates printWindow(0)
or less if it works
ok..
do you know how to do that?
yea
ok..
do that and tell me if it works…
dont work
problem is focus seems to be returned after the js function executes
so it redisplays the window
er
button
reload it
i made it alert on focus
show me your code
notice when ya click the button
it popups up and says focus
can you show me your code….
ya
pastebin is slow
hold
http://www.pastebin.ca/666328
The paste 666328 has been copied to http://erxz.com/pb/4131
didn't you forget a 0?
no, was leftover from the resize function
printwindow(0)?
oh, ok
just got rid of it
but wait
you don't need the focus part anymore
how will it redisplay the buttons?
did you try it with the timer and without the focus?
worry about that later
thats all i'm worried about
it hides the buttons and prints fine
so it does work?
yea, that has worked
ok, so now the buttons
the problem is focus gets returned
s it redisplays them
ok ok hold on
why not set a timer on the onfocus?
what'd the timer do?
well, actually…
when does the onfocus activate?
when the button is clicked right?
right after your onclick
yea
ok so you need to set a global var
set a global var when the timer is set
or rathr..
how about this
onfocus, set a var
nono…
well
global it on print
and then onfocus check for it
works
if (var1 == 1) {make buttons visible, set var to 0} else {set var to 1}
you could do that too
the disturbing part
but just put the global var in the onfocus
easier to maintain
it worked on the other test page i did
but not this page
maybe your onfocus action was defined at a different time vis-a-vis your onclick action
http://www.icegn.net/test2.html
check it
its odd
idk,
but your page isn't totally fixed yet
i have an error in IE6…
and ur global var isn't in the onfocus
ya, error is cause it onfocus and printed doesnt exist yet
printed being the global
haha
guess what was causing it to refocus?
right; in the div tag
if i remove it, it doesnt return focus to body onclick
er no
position:absolute;
thats what it was
o_O
thats good to know
and also quite strange
aye
does a mix of position: absolute and float make sense?
heh nope
anyway, going to sleep, nn
the code is so bastardized from where it came from
trying to figure that out
: )
evenin
`dom ref @ Woosta
dom ref: http://w3.org/DOM , http://mozilla.org/docs/dom/domref/ , http://krook.org/jsdom/ , http://www.zvon.org/xxl/DOM2reference/Output/index.html
`ajax ref @ FlashWolf
nothin?
ow
xit
have 2 go
There is no such thing as ajax .. it's a concept
cya plpe
`js ref xmlhttprequest // this may be what you want
The XMLHttpRequest Object specification defines an API that provides scripted client functionality for transferring data between a client and a server. http://www.w3.org/TR/XMLHttpRequest/
sorry…
wht shame…
so long
so long folks
mom is callin me
xD
how do i switch the order of an array ? like i have: [1] = blah [2] = hello [3] = bye have it [1] = bye [2]=hello [3]=hello ?
`js ref splice @ Elagic
js ref splice: Changes the content of an array, adding new elements while removing old elements. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:splice)
that is a script?
i want to know how to do it manually
no, it's a command ..
so i can modify this table sort you gave me
to make it list ASC and DESC
note the URL "Core Javascript 1.5 Reference"
Oh, you just want reverse?
yeap
just to reverse them
`js ref reverse //
bah
`js ref reverse
Transposes the elements of an array: the first array element becomes the last and the last becomes the first. (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:reverse)
ownage
thanks
excelent
Woosta considering the code you gave me, where would you put the tableData.reverse(); ?
i made it i thin
had to change the class of the th to verify if it was asc or dsc
Woosta this has a problem, its doing if th.className == "asc" it wont match if class= someclass anotherclass asc
for example
how to say "if asc is in classname" ?
actually " asc "
if( /\basc\b/.test(foo.className) ){ it's there }
that is a regexp match?
yes
that is the .test for?
that's a method of the Regexp object
wow
weird name for a method
:P
lets try it
A lot faster than the match method of string
kewl
regex rules
\b is a word break .. it will work if you don't try using hyphens in your class names
damn, im spanish, hyphens were?
works very good
oops i found a bug
if asc is in className it makes a .reverse() and sets className to desc
class="foo-bar" will match the regex as two words
but that will lose the rest
you'd have to replace the asc with desc
actually \basc\b with \bdesc\b
foo.className = foo.className.replace(/\basc\b/, 'desc')
exactly
but desc should have \b also right?
No
\b is for matching
oh ok thought it was to match a space
no, it's a zero-width word boundary
ownage
it werks
and i still cant find out how to remove $ and , from matching string … anyhelp ? ;o
vbm, are you there
yup
still having problems?
yes :$
"and i still cant find out how to remove $ and , from matching string … anyhelp ? ;o"
what are you talking about?
$ 1,000,000 ( that's million dollars and i want to have just numbers … 1000000 )
yeah ok
i know A way to do it
It's not the shortest or the most efficient but it's A way
it's a string, right?
yup
(typing)
tnx for your help in advance
"$1,000,000
Error: Error: unterminated string literal at line 0: "$1,000,000
oops
noooo this is mine
"$1,000,000".replace(/\D+/g,'')
1000000
don't say anything
goddrn67d467dn578mfd689,g7.890890,m567
type faster
haha
ignore woosta
i will … he's a bad dude
for (i = 0; i mystring.length; i++) {
for (var i = 0; i mystring.length; i++) {
"$1,000,000.99".replace(/\D+/g,'') // I'll leave this one for you to fix though
100000099
"$1,000,000.99.99".replace(/\D+/g,'') // And how do you want to treat this one?
10000009999
;o
no wait.
dont confuse me ;/
let's do this.
and it's always in the form $1,000,000?
that is, the commas and such
no decimals
and nothing silly like $0?
or $000?
there is sometimes $ 0
it's a bank page :]
$ 0?
like "$ 0"?
yup
…
can you control the entry form?
yes
you need to make the entry form not accept invalid values like "$ 0"
don't allow any keys except $0123456789.
and ,
allow ,
$ and , is not allowed
strip out the ",", we don't care if it's in the wrong position
then it's not really a problem is it
lolz
ok don't allow anything except "0123456789."
do you know how to do this?
well … if i knew i wouldnt ask
oh and one more thing
you don't want a hacker to crash the system
so you need to do client side checking later
i mean..
server side checking
you can't trust input that you get from the form
it's for greasemonkey script … and it's for web game i'm playing ;d
a bank?
in a game?
yup
you're programming a bank in a game? what?
…..
?
im trying to create "withdraw money" button
As opposed to withdrawing it some other clumsy way
click on amount that is visible in td … remove $ and , and fill in the form
more or less
but the website that you don't control receives the data?
um… anyway… someform.onkey() should not allow the $ and ,