Email conversation
From | TTech |
To | Me |
Subject | mini-window: XML parsing? |
Date | 22 December 2005 21:38 |
Hi,
Nice scripts, but when I was looking at the code to put in my content, I saw
that the menu for the mini window is in the HTML page and you have another
script the XML parser ? Could it be used for parsing the menu? That way the
page could be freed up a little... Here's and example of the "file menu" :
<item text="File" id="javascript?" select="1">
<item text="Open" id="http://www.google.com"/>
<item text="Edit" id="edit?">
</item>
_________________________________________________________________________________
I'm not great at XML but that would be File on the menu and I'm not exactly
sure but select maybe could be open and if it's 1 it is the top of the menu
File and every thing below until </item> would be part of that menu. The id
would be the link and or JavaScript. Or another idea is that the id could be
linked to an other XML file or java script and that gives the link. But any
way this is just an idea. Thanks.
From | Me |
To | TTech |
Subject | Re: mini-window: XML parsing? |
Date | 22 December 2005 21:56 |
> the menu for the mini window is in the HTML page and you have another
> script the XML parser ? Could it be used for parsing the menu?
Not without some difficulty since the data is needed before the page has
loaded, and importing XML is only reliable after the page has loaded.
You could simply move the menu definition into an external JavaScript file.
There is no need to play around with additional formats like XML.
> the id could be
> linked to an other XML file or java script and that gives the link.
Although the id attribute has no specific meaning in XML like that, I
recommend never abusing a single attribute like that. Just make an
appropriate attribute for each use:
text="Open"
script="javascript:window.open('foo')"
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | TTech |
To | Me |
Subject | Re: mini-window: XML parsing? |
Date | 22 December 2005 22:04 |
I still have a few questions but thanks for the quick reply...
With the java script using the external file you mean like a .JS file? How
would you do that exactly? Thanks
Last question, with the XML your reply said that text="Open"
script="javascript:window.open('foo')" where would the script= go with in ?
<item text="File" id="javascript?" select="1">
<item text="Open" id="http://www.google.com"/ >
<item text="Edit" id="edit?">
</item>
_______________________________________
But thanks again...
From | Me |
To | TTech |
Subject | Re: mini-window: XML parsing? |
Date | 22 December 2005 22:17 |
> With the java script using the external file you mean like a .JS file? How
> would you do that exactly?
create a file called foo.js and put the menu definition into it:
contNt.sub[0] = new displayBasedSub('File');
... etc ...
contNt.sub[3].sub[0] ... etc ...
then add it at the top of the HTML page:
<script src="foo.js" type="text/javascript"></script>
> Last question, with the XML your reply said that text="Open"
> script="javascript:window.open('foo')" where would the script= go with
> in ?
>
> <item text="File" id="javascript?" select="1">
> <item text="Open" id="http://www.google.com"/ >
> <item text="Edit" id="edit?">
> </item>
something like this:
<item text="Open" script="javascript:window.open(\'foo\')">
But like I said, you really cannot reliably use an XML based solution with
that menu script.
From | TTech |
To | Me |
Subject | Re: mini-window: XML parsing? |
Date | 22 December 2005 23:03 |
O.K I think I got it is there a way not to get the links to open in a new
window? Thanks
From | Me |
To | TTech |
Subject | Re: mini-window: XML parsing? |
Date | 23 December 2005 08:53 |
> O.K I think I got it is there a way not to get the links to open in a new
> window? Thanks
The script I used in my example uses:
window.open(\'someURL\')
You can either use:
window.open(\'someURL\',\'_self\')
or:
location.href = \'someURL\'
From | TTech |
To | Me |
Subject | Re: mini-window: XML parsing? |
Date | 23 December 2005 17:32 |
Ah, O.K
Thanks For all your help ! Also thanks for your quick responses...
From | Me |
To | TTech |
Subject | Script Problem... |
Date | 5 January 2006 19:33 |
Hi,
The script is Movable Mini-Windows,
What happened is after I downloaded it I got the windows but the "window box"
stayed in one spot and does not move I hid the layers and it works
sometimes but after a little while the windows start falling apart. Some
things that happen are the expand image goes to some spot on the page and
works but will not move other times it stays in the middle of the window.
Then with the button at the top when it's in dreamweaver 8 I get all the
buttons close max, min but when I try in in FireFox I get the image not
found icon and will not load. What's going on? Thanks (if you want to see it
I have a picture of it ) Thanks...
From | TTech |
To | Me |
Subject | Re: Script Problem... |
Date | 8 January 2006 23:39 |
> The script is Movable Mini-Windows,
> What happened is after I downloaded it I got the windows but the "window box"
> stayed in one spot and does not move I hid the layers and it works
> sometimes but after a little while the windows start falling apart.
Tell me, did you save the page using Firefox ? because Firefox never saves
pages properly if it has parts that are dynamically generated. I recommend
that if you want to save the demo page, you use Opera, since it does not
break the script.
If that is not the case, is the code that you are putting into the mini
window valid? It will get confused if you forget to close tags.
If that is also not the case, do you have a demonstration page where I can
see the problem for myself?