Closed
Bug 90788
Opened 24 years ago
Closed 24 years ago
[RFE] Ability to add search string to binding url
Categories
(Core :: XBL, enhancement)
Core
XBL
Tracking
()
VERIFIED
INVALID
People
(Reporter: jasonkarldavis, Assigned: hyatt)
Details
I noticed earlier that when I add a search string to a binding:
-moz-binding: url(test.xml#test?args=bla)
that the document will not render (At least on Win98 with Mozilla build
2001062815).
I think that if you could do this, XBL will become even more powerful, you
would be able to create dynamic bindings, passing an argument to the binding
itself, rather than create an entirely new binding which uses the exact same
code, save for a difference in one or two variables.
For example, let's say that you create a "fadeTo" binding that fires for links
onmouseover, and you want to be able to dynamically select the finishing color.
Instead of creating a binding for every possible color, you can initialize a
variable passed through the search string of the binding on the mouseover event:
eval(document.defaultView.getComputedStyle(this,'').getPropertyValue('-moz-
binding').split('?')[1]);
and that would initialize the color variable of the below binding:
-moz-binding: url(color.xml#fadeto?color=adf1ad);
And inside the handler element for the mouseover event:
this.fadeTo('#'+color);
Whereas I defined the fadeTo somewhere in the implementation.
Or perhaps something like the 4th argument of the window.openDialog() method,
you could provide a special way of passing information to a binding, accessible
through an array (let's call it arguments[] for now) inside the binding
document. The arguments[] array would make it even easier to retrieve
information than through the search string idea I presented.
Reporter | ||
Comment 1•24 years ago
|
||
Just realized I had mixed up the positions of the hash and the search string,
early morning stupidity I suppose. Very sorry for the spam, I'll mark this as
invalid.
var
bindVal=document.defaultView.getComputedStyle(this,'').getPropertyValue('-moz-bi
nding');
bindVal=bindVal.substr(bindVal.lastIndexOf('/')+1);
color=bindVal.split('?')[1].split('#')[0].split('=')[1];
this.style.backgroundColor='#'+color;
Inside a handler tag works fine for a binding as such:
-moz-binding: url(test.xml?color=000000#dyn);
Once again sorry.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•