JQuery :: Selector With Custom Namespace Tags
Dec 9, 2009I need to get a reference to a tag with a custom namespace, e.g.: <foo:MyTag/>. I've tried $("foo:MyTag") but that doesn't seem to work.
View 5 RepliesI need to get a reference to a tag with a custom namespace, e.g.: <foo:MyTag/>. I've tried $("foo:MyTag") but that doesn't seem to work.
View 5 RepliesActually the selector works in this form:
$objects = $("dl\:object",contextelement)
but not in this form: $(element).children("dl\:object").I don't care that it doesn't work in the second, because I only need one time access, since I replace these custom elements with valid html using javascript, as soon as the page loads (sort of like xfbml I guess).My concern is that it DOES work even in IE, which only returns a tagName of "object" from <dl:object>. (given the following html attribute: <html xmlns:dl>). So I'm suspicious. I've tried following the code that matches the selector, but I can't do it, it's too complex for me to follow in a reasonable time.
Here's what I'm trying to do:
1) I get reference to a div that's on my page:
var theDiv = $("#" + divID);
2) Now I want to add a custom attribute tag to it, so for instance I want to add "winWidth" so that the div object now contains "winWidth=" for instance.
3) I want to set winWidth now since it's part of theDiv to a value
I'm not sure how to really do 1 + 2. I need to do this on the fly because some javascript logic later will add these attributes dynamically to the div... outside of what the original div had...I don't care what it had, I know I have it now in a JS variable and now I want to both add some new attributes to the div, and then set them on the fly. I don't need these attributes to be on my page, I just need them added to my div variable reference.
I would like to include extra "hidden" information in a generated HTML page
that can be used by javascript functions.
I realise that most browsers seem to ignore any tags and attributes they
don't understand, but from what I can tell the standards do not allow me to
make up my own tags or attributes as they will fail validation.
is there any standard element name that can be used for such a purpose i.e.
passes validation but never produces any output (and ideally allows nested
elements to be rendered normally too)...
Does anyone know of a way to wrap custom tags around selected text
using execCommand or otherwise?
I am developing a rich text editor for use in a web site and while
there are a few decent ones already floating around I need to
implement a few extra bits of functionality. Specifically tool tips.
Idealy I'd like to wrap custom tags around selected text using
execCommand. Ie "Selected Text" becomes:
"<a title='User inputed tooltip'>Selected Text</a>".
Any ideas?
I need to replace custom tags to spans. I have:
Code:
<block style="color:blue" class="block01" limit="100">This is a block</block>
I need to fetch the attributes and add them to a span, like:
Code:
<span style="color:blue" class="block01" limit="100">This is a block</span>
There's a few on the page so I need to change all of them some may have many attributes.
I am trying to find how to use custom tags in html and render data based on their use.
A good example is the joomla <jm:whatever> tag.
I found the following article: [url]
I think it might be outdated though because the behavior:url element does not seem to work. Plus, when I check the style sheet on a joomla site, it doesnt seem to use this method. I think these tags might be xml but I do not know how to render them based on the tag.
For example: <customAbbrv:display src="test.html" label="Test" />
I would want this tag to fire test.html and pass the attribute label which is set to Test.
I'm working on an app, which createsvisualizations based on SVG. I was using jQuery SVG by Keith Wood at first [URL], but at some point I've noticed that it's very inconvenient for some stuff and wrote my own functions to handle everything. One of the quirks when creating svg trees dynamically is that you have to create all elements and set attributes using the SVG namespace ("[URL]"), otherwise they aren't rendered correctly by browsers.
Here's an example of how you create a text element...
var svgns = "[URL]";
var newText = document.createElementNS(svgns,'text');
newText.setAttributeNS(null,"x","0");
newText.setAttributeNS(null,"y","0");
$(newText).text("some text");
$(svgGroup).append(newText);
There doesn't seem to be a way to do that more effectively using jQuery. For instance, you can't use attr to set multiple attributes, since it won't use setAttributeNS.
var BN = {
foo: function() {
alert("hello world");
},
z: function() {
alert("hello world");
},
}
I would like to add a member moo to BN whose definition is
var moo = {"a":"A","b","B"};
How do I do it?
Using the Firebug console is there a way to log the content of the global namespace? I particularly want to recognise when something is added to it by my code. I could step through my whole code :( but I'm hoping there is an easier way.
View 3 Replies View RelatedI know function name can be invoke by string using the following:
window[functionName]
But how do I use this for namespace function i.e. myname.function ?
I am having an issue with adding namespaces to my JavaScript. When I run this code in FireFox everything works fine. When I run this code in IE7, I get and error saying “Not Implemented�. It is pointing to the line of code where I Instaniate the object (testNameSpace.menu = new js.JavaScriptCodeIsHere(); ). Does anyone know why this works in FireFox but IE7 tells me I have not implemented something? Code:
View 2 Replies View RelatedAre there any difference between class selector and ID selector
View 2 Replies View RelatedCan't seem to make it work, I have seen many examples but they are all just for 1 div tag. When i trymore than one it doesn't work anymore.The first one works, if i have more than 1 then the other don't work.
using the following jquery
$(document).ready(function(){
$("#toggle-text").click(function () {
var divvalue= this.value;
[Code]....
I'm trying to find an example of a country selector (which also provides a state selector if USA is chosen) then you cvan select the city, any samples out there?
View 2 Replies View RelatedI use Firefox and am wondering how to select a word and wrap [b] tags or [quote] tags around it?
View 30 Replies View RelatedThe DOM Level 3 specification has a section (1.2.2.2) that talks briefly about "groups" of event listeners. What does this mean? Is this similar to attaching event listeners with a namespace, as in jQuery: "event.my_namespace"?
View 2 Replies View RelatedI have seen namespaces created (or really to avoid creating namespaces) like this
(function () {
alert("hi");
})();
but today I saw this
new function() {
alert("hi");
};
Is there a difference? The second one looks much cleaner so I'd prefer to use that one.
Is it possible to trigger the action of a form with a submit button that's outside the form tags? If so, how should this example be rescripted to make the input tag work outside the form tags?
View 3 Replies View RelatedI really know nothing about how to code JavaScript (I know what it is and what it does) and I need a script to go in the head of my page and look for all <a> tags that have <img> tags inside of them and add a rel="lightbox" attribute to them.
View 6 Replies View RelatedI'm using the jquery in place editor, and I need to get the value of a custom attribute in order to send it with the form. The jquery I have is as folder... (the bit I'm having trouble with is highlighted)
$(".edit").editInPlace({
url: "./server.php",
params: "folder=" + $(this).attr('folder')
//show_buttons: true
//$('.edit').attr('folder')
});
And the html is as follows:
<span class="edit" folder="folderName">text to edit</span>
As you can see, I need to get jquery to get the attribute 'folder' value, in this case the value returned would be 'folderName'.
I was reading about delay() in the API ref and it mentioned it used the standard effects queue or a custom queue, but didn't illustrate how you set up a custom queue.
View 2 Replies View RelatedI was wondering if it is possible to do something like the following:
$
(
'div'
)
[code]....
Basically I often want to be able to directly start using the $(this) selector without having to use an existing function like .each().
I'm trying to use some custom events but I don't know how to check if a custom event has already been sent.
I have a script "startup.js", which do some stuff then triggers a custom event "jobDone" on the body element (only one time) :
startup.js :
$(function() {
// do some stuff
$('body').trigger('jobDone');
});
[Code].....
Has anyone performed or seen a customization of validatepassword? I'm looking to create a custom validation and don't know where to start.
View 5 Replies View RelatedI have a table that sorts in jquery and I have one column that I would like to always remain the same while the other columns sort around it. What I want is for the order of the column to always be Great, Bad, Failure while every other column can be sorted. What is the easiert way for me to do this?
View 1 Replies View Related