|
I'm asking this question for a friend who's trying to use javascript to run an experiment which gathers data through people going through the test. It's mainly on the whole signal to noise ratio testing, seeing how quickly people learn patterns and such. I'm going to admit knowing gently caress all about javascript right here, but I figure the question is general enough that I can explain it well enough. I'm this close to just scrapping the javascript in general and rewriting it myself in some other programming language, but I figure that if I could find something, it would save a few hours of work. See, in this experiment, reaction time is important, but there seems to be a variable amount of lag due to IE (or so he claims) trying to run and do things in the background, and FireFox is worse about it, so it throws off the reaction times recorded from the experiment. What I'm curious as he is too is if there's a way to run javascript outside of a browser in some standalone format? Like a Java applet or somesuch? Basically just.. something that'll spawn a window that isn't dependent on a browser or something like that. He was pretty new to Javascript as well, so he wasn't sure what to use either, and again, I know nothing about Javascript, other than that it's used in websites. I've looked around but I haven't found anything that seems to work well, so I figured I'd let myself look here and ask.
|
# ? May 6, 2009 22:16 |
|
|
# ? May 6, 2024 03:17 |
|
Hi guys, quick question for you. I've got a whole bunch of xml files which use a stylesheet to be displayed as HTML. The files are organized by folder on my computer, so that the structure looks something like this: Main Folder --Folder A ----1.xml ----2.xml ----3.xml --Folder B ----4.xml ----5.xml --Folder C ----6.xml ----7.xml The number of files in each folder as well as the number of folders themselves can change, so I'd like to try and dynamically build a link tree. Using javascript to create the tree and the links is easy enough, but I'm stuck trying to figure out how to grab the names of these files/folders. I've found a bunch of stuff about the Scripting.FileSystemObject ActiveX object, but it seems to be pretty useless because of the security constraints and the fact that Firefox doesn't seem to support it. Do any of you know of any other methods I could use to list all of the files and folders residing under the Main Folder? Thanks in advance! Blackout fucked around with this message at 23:40 on May 6, 2009 |
# ? May 6, 2009 23:38 |
|
Crysinth posted:See, in this experiment, reaction time is important, but there seems to be a variable amount of lag due to IE (or so he claims) trying to run and do things in the background, and FireFox is worse about it, so it throws off the reaction times recorded from the experiment. Pretty sure any given browser's implementation of JavaScript is going to be faster than any given human's reaction time, but I could be wrong. How is he trying to time stuff? Unless he's somehow blocking the browser with while(true) { ... }, time is time and will be pretty accurate. If nothing else the start time and end time would be "off" by approximately the same amount, if it's just due to browser overhead. Reaction time would be the difference between the two, so still accurate. Can he just ask that they close other browser windows while testing whatrever he's testing? Or what else is running?
|
# ? May 7, 2009 04:06 |
|
Supervillin posted:Pretty sure any given browser's implementation of JavaScript is going to be faster than any given human's reaction time, but I could be wrong. I was actually thinking that the overhead would be off by a similar amount and could simply be subtracted, but thanks for reminding me of that. I'm actually going to try to get a hold of him to find out the exact problem he was having, I just remembered him asking me for help a little while ago. Those are some good ideas though, I'll have to pass them by him, and I'll have a follow-up of some sort when I do talk to him again about it.
|
# ? May 7, 2009 06:39 |
|
Blackout posted:Hi guys, quick question for you. I've got a whole bunch of xml files which use a stylesheet to be displayed as HTML. The files are organized by folder on my computer, so that the structure looks something like this: Gonna assume you're talking about javascript in the browser since you mentioned Firefox. What you're trying to do here is traditionally a server-side thing with languages like PHP or ASP, and not done in the browser. If you're hosting your site on IIS then you are actually able to write ASP code using javascript and the FileSystemObject but this all runs on the server and security constraints aren't relevant here. If you have no sever-side programming ability and you're a true masochist you could potentially try and do something that uses ajax to parse directory listing pages on the server and build the tree from that, but don't.
|
# ? May 7, 2009 06:56 |
|
jupo posted:Gonna assume you're talking about javascript in the browser since you mentioned Firefox. What you're trying to do here is traditionally a server-side thing with languages like PHP or ASP, and not done in the browser. If you're hosting your site on IIS then you are actually able to write ASP code using javascript and the FileSystemObject but this all runs on the server and security constraints aren't relevant here. Thanks for the advice, jupo! I guess I'll try to use IIS to do some server-side scripting with ASP or something.
|
# ? May 7, 2009 11:58 |
|
Backstory I asked this in the .net megathread but it's really a javascript question. I've got an updatepanel in an ascx page. Basically this is an asych call that requests new data for a particular DOM. It gets data back from a server and updates the DOm based on that data. This is using the microsoft ajax framework and is all automatic - Microsoft software communicating to Microsoft software through a Microsoft server. 99 times out of 100, this works fine. My issue: 1 time out of 100, the DOM gets updated and the window doesn't redraw properly, The user has to maximize the browser or do something else to trigger a redraw. Putting javascript in to force a resize doesn't seem to work - it has to be done by the user. Sometimes the browser gets refreshed once the user's mouse leaves the window and comes back. This is a huge pain in the rear end because it looks unprofessional but it's all pre-canned stuff I have no control over. Request: I'd very much like to force Internet Explorer to refresh its display using javascript. The DOM changed and I want the view of the page to reflect the change without the user having to jiggle the window around.
|
# ? May 7, 2009 16:00 |
|
diadem posted:1 time out of 100, the DOM gets updated and the window doesn't redraw properly Modifying the DOM again should trigger it, some libraries (I think scriptaculous?) create, append, and remove a text node containing only spaces. I did a little searching and found that adding and removing a class, or even just reassigning a class works. code:
|
# ? May 7, 2009 16:56 |
|
Supervillin posted:Modifying the DOM again should trigger it, some libraries (I think scriptaculous?) create, append, and remove a text node containing only spaces. I did a little searching and found that adding and removing a class, or even just reassigning a class works. While I haven't run into this problem in a while, and we came up with some other workaround or solution... this is great to know for future reference. Thanks!
|
# ? May 7, 2009 17:52 |
|
Supervillin posted:Modifying the DOM again should trigger it, some libraries (I think scriptaculous?) create, append, and remove a text node containing only spaces. I did a little searching and found that adding and removing a class, or even just reassigning a class works. Thank you so much. This bug was a huge pain. For some reason, spaces weren't cutting it, but characters worked fine. A slightly modified version of your last suggestion fixed the issue. var t = document.createTextNode('temp text'); element.appendChild(t); setTimeout(function() { t.parentNode.removeChild(t); }, 0); diadem fucked around with this message at 19:34 on May 7, 2009 |
# ? May 7, 2009 19:22 |
|
diadem posted:Thank you so much. This bug was a huge pain. You're just triggering a reflow as far as I can tell, here's a good article about browser reflow. http://www.stubbornella.org/content/2009/03/27/reflows-repaints-css-performance-making-your-javascript-slow/
|
# ? May 7, 2009 20:13 |
|
diadem posted:Thank you so much. This bug was a huge pain. A non breaking space would work there too . Apparently you can't type & nbsp ; here, let me try it in a code block code:
sonic bed head fucked around with this message at 20:38 on May 7, 2009 |
# ? May 7, 2009 20:34 |
|
Hey, I'm back again with another question! I managed to solve the problem I was having earlier using ASP (dynamically creating a bunch of links based on files/folders). Now, I'm trying to create a summary section for each of the groups of files. I've got an asp file which creates all of my links, and inside that same file, I've got a function that will create html and return it in a string. This asp file is located in one frame, and I have a target frame next to it. I'm trying to figure out a way to create a link that will, rather than displaying another page in the target frame, call this function and display the html that comes back in the target frame. So basically, when I click link A, I want it to call function B and show what the function returns in frame C. Hopefully thats not confusing... Thanks!
|
# ? May 7, 2009 21:04 |
|
Blackout posted:Hey, I'm back again with another question! code:
|
# ? May 7, 2009 23:38 |
|
nm
aksuur fucked around with this message at 03:45 on May 10, 2009 |
# ? May 8, 2009 00:32 |
|
Supervillin posted:Pretty sure any given browser's implementation of JavaScript is going to be faster than any given human's reaction time, but I could be wrong. Well, I got a bit more info, so I hope it helps towards actually figuring out a solution. Hrm, apparently the problem is that he's wanting things down to the millisecond. The thing is that whenever the user clicks, he mentions there being a chance that the browser attempts to ping something and causes a 200 ms delay in the timing mechanism, and that it variably does this, making the data off at random. He's tried different ways of storing the data to avoid the ping possibly affecting it, and tried keeping the browsers he tested (IE and Firefox) in offline mode, but with no luck with that, either. Nothing else running. He did mention though that even his usage of Javascript might be causing the problem, but I'm not sure.
|
# ? May 8, 2009 01:43 |
|
Blackout posted:Thanks for the advice, jupo! I guess I'll try to use IIS to do some server-side scripting with ASP or something. No problem! Being able to write javascript on both the client and server is actually a really nice environment to work with.
|
# ? May 8, 2009 01:50 |
|
aksuur posted:Why won't my jquery load work in firefox? It work's in IE just fine. test/test isn't working with FF or IE bro.
|
# ? May 8, 2009 01:53 |
|
Crysinth posted:Well, I got a bit more info, so I hope it helps towards actually figuring out a solution. I suspect its your friend's code. Browsers don't randomly ping stuff, and JS can easily deal with ms response times. Make sure your test doesn't start until after the document and DOM fully load, don't do any synchronus stuff while the test is running, and you'll be fine.
|
# ? May 8, 2009 01:55 |
|
Lumpy posted:
That would be really easy, but my situation is a bit different. I've got my function in blah.asp, but I want to call it in multiple spots, passing different parameters. The HTML that the function returns is what I want to create a link to, not the asp page itself. Lets say I have the following page where each xml is a link: Header A - 1.xml - 2.xml Header B - 3.xml - 4.xml For each of the headers, I want to call this function in blah.asp, which will return html for a page containing a summary of stats for the xmls under the given header. I then want to create a link under the header that, when clicked, will display that HTML in my target frame. So its a bit more complicated than putting an asp file in a link...
|
# ? May 8, 2009 02:20 |
|
Lumpy posted:I suspect its your friend's code. Browsers don't randomly ping stuff, and JS can easily deal with ms response times. Alright, I'll see what I can do and pass on the info to him. Thanks a lot, the advice is much appreciated.
|
# ? May 8, 2009 03:31 |
|
nm
aksuur fucked around with this message at 03:45 on May 10, 2009 |
# ? May 8, 2009 04:50 |
|
Blackout posted:That would be really easy, but my situation is a bit different. I've got my function in blah.asp, but I want to call it in multiple spots, passing different parameters. The HTML that the function returns is what I want to create a link to, not the asp page itself. So you want a link under each header, then when clicked, runs blah.asp but produces different HTML based on which header link you clicked: code:
|
# ? May 8, 2009 05:11 |
|
Lumpy posted:So you want a link under each header, then when clicked, runs blah.asp but produces different HTML based on which header link you clicked: Yeah, I apologize for the de-rail too, but I couldn't find an asp thread! Thanks alot for the help Lumpy! As you can tell, I'm pretty new to this, so I really appreciate it!
|
# ? May 8, 2009 14:31 |
|
This is my art site: no apparent function The gallery consists of a rectangle sliced up into thumbnails, each one showing the full-sized image with LightBox. What I would like to add now are horizontally-scrolling sets of these small galleries to add more content without compromising the layout of the page. One rectangle could consist of artistic images (paintings, etc), and another could be a few graphic design jobs I've done, for example. Small links reading "art" and "design" on the bottom of the grid could trigger the changes. I'm familiar with JavaScript and how to upload .js files, but this particular one I have no clue how to implement. Here are some templates and examples I found: http://demos.flesler.com/jquery/localScroll/ http://demos.flesler.com/jquery/serialScroll/ http://www.hotel-oxford.ro/ My questions: 1) How do I create this long horizontal page without adding scrollbars to the frame cell or exploding the page sideways? 2) How can I make the stationary scroll links target the particular cell of grids? Thanks. If this is the wrong thread, I'll move it to the Web Design/Development one. noapparentfunction fucked around with this message at 18:42 on May 11, 2009 |
# ? May 11, 2009 18:39 |
|
noapparentfunction posted:1) How do I create this long horizontal page without adding scrollbars to the frame cell or exploding the page sideways? noapparentfunction posted:2) How can I make the stationary scroll links target the particular cell of grids? Can't speak specifically for the demos you linked to, but it seemed they all have fixed-size containers, which means they know "where other content is". For example: code:
Edit: Looking at that Hotel Oxford source code, find <div id="contents_wrapper">, that's the container above. All the divs with class "content" are the fixed-size boxes. Not exactly the same implementation, of course, but same concept. Supervillin fucked around with this message at 04:32 on May 12, 2009 |
# ? May 12, 2009 04:26 |
|
Can anyone write me a relatively easy function? Im looking for a method to be called from a textarea that counts the character length, but updates a div with the total count and changes the class if its over a limit. So for each example youd see a textarea, when you typed something there would be a div with like 0/100, 50/100, 200/100 as you are typing, but it doesnt restrict if you go over the limit, it just changes the css class so it looks red or something, where its green if its under the limit.
|
# ? May 13, 2009 03:40 |
|
FateFree posted:Can anyone write me a relatively easy function? Im looking for a method to be called from a textarea that counts the character length, but updates a div with the total count and changes the class if its over a limit. Style and Script code:
code:
Lumpy fucked around with this message at 05:56 on May 13, 2009 |
# ? May 13, 2009 05:49 |
|
Thanks alot lumpy I appreciate it. It works fine in IE but not in FF so im looking into that, but otherwise does just what I wanted. edit: firefox wanted .textContent instead of innerText FateFree fucked around with this message at 13:25 on May 13, 2009 |
# ? May 13, 2009 12:38 |
|
FateFree posted:Thanks alot lumpy I appreciate it. It works fine in IE but not in FF so im looking into that, but otherwise does just what I wanted. .value should work in both.
|
# ? May 13, 2009 13:51 |
|
FateFree posted:Thanks alot lumpy I appreciate it. It works fine in IE but not in FF so im looking into that, but otherwise does just what I wanted. Huh, th's odd, I tested in Safari and Chrome and it worked, assumed it would in FF. Normally I'm not lazy enough to use innerText and do the whole childNode thing.
|
# ? May 13, 2009 14:31 |
|
sonic bed head posted:.value should work in both. Eh that didnt work for either, I think because its not a form field, rather just text.
|
# ? May 13, 2009 15:49 |
|
FateFree posted:Eh that didnt work for either, I think because its not a form field, rather just text. Since it's a DIV, .innerHTML should work everywhere.
|
# ? May 13, 2009 16:10 |
|
Supervillin posted:overflow: hidden in your CSS "turns off" scrollbars, then you would use JS to scroll the div to particular coordinates. I appreciate the help. I was looking at my code and I realized that I wrote my tables mainly in plain HTML. How do I add overflow: hidden in that case?
|
# ? May 13, 2009 17:20 |
|
noapparentfunction posted:I appreciate the help. I was looking at my code and I realized that I wrote my tables mainly in plain HTML. How do I add overflow: hidden in that case? Give them ids or classes. Or come up with a CSS selector that targets only the tables you want, e.g. code:
|
# ? May 13, 2009 19:10 |
|
FateFree posted:Eh that didnt work for either, I think because its not a form field, rather just text. Oops, I completely misread that code. I thought you were trying to get what was inside the form field.
|
# ? May 15, 2009 21:02 |
|
I have a relatively simple slider code on this test page I uploaded. It uses jQuery, but my only problem with this premade application is that it uses those rounded browser buttons to operate. Is there a way to convert these to standard links, preferably ones that use images? http://noapparentfunction.com/test4/ Thanks.
|
# ? May 22, 2009 17:24 |
|
noapparentfunction posted:I have a relatively simple slider code on this test page I uploaded. It uses jQuery, but my only problem with this premade application is that it uses those rounded browser buttons to operate. Is there a way to convert these to standard links, preferably ones that use images? I think you could use an onClick=function() on pretty much any HTML element instead of checking each of the buttons to see if they're clicked.
|
# ? May 22, 2009 17:29 |
|
royallthefourth posted:I think you could use an onClick=function() on pretty much any HTML element instead of checking each of the buttons to see if they're clicked. Thanks for the suggestion. I just tried creating a second set of links at the bottom using onClick containing the same functions as the buttons. They don't seem to work though. Any other ideas?
|
# ? May 22, 2009 18:33 |
|
|
# ? May 6, 2024 03:17 |
|
noapparentfunction posted:Thanks for the suggestion. I just tried creating a second set of links at the bottom using onClick containing the same functions as the buttons. They don't seem to work though. Any other ideas? Look at the number of quotation marks in this (underlined for emphasis): pre:<a href="#" onclick="function() { $(".widearea").animate({ marginLeft: "0px" }, 500">art.</a>
|
# ? May 22, 2009 18:59 |