|
Hey guys, quick question. I'm trying to write a very simple piece of javascript that does two things. First, it will either show or hide an HTML div with the first id I specify. Second, it will change the text of the div with the second id specified. It should toggle these things, so if the div is shown, it will be hidden and vice versa. Same thing with the text (switches between 'Show...' and 'Hide'). Thing is, I'm doing this through an xsl stylesheet. I've got a separate javascript file that the stylesheet references. I've used my javascript functions elsewhere in the stylesheet and they work fine, but in this instance, I'm using xml attributes as ids for the divs, and I'm getting weird results. In IE, the text will toggle just fine, but the div won't disappear/reappear. In Firefox, the show/hide works but the text will only toggle once. Here is the java script: code:
code:
Thanks!
|
# ¿ Apr 21, 2009 17:02 |
|
|
# ¿ May 6, 2024 06:57 |
|
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 |
|
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 |
|
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 |
|
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 |
|
|
# ¿ May 6, 2024 06:57 |
|
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 |