Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 227/433 | < Previous Page | 223 224 225 226 227 228 229 230 231 232 233 234  | Next Page >

  • JavaScript (via Greasemonkey) failing to set "title" attributes on <a> tags

    - by rjray
    I have the following (fairly) simple JavaScript snippet that I have wired into Greasemonkey. It goes through a page, looks for <a> tags whose href points to tinyurl.com, and adds a "title" attribute that identifies the true destination of the link. Much of the important code comes from an older (unsupported) Greasemonkey script that quits working when the inner component that held the XPath implementation changed. My script: (function() { var providers = new Array(); providers['tinyurl.com'] = function(link, fragment) { // This is mostly taken from the (broken due to XPath component // issues) tinyurl_popup_preview script. link.title = "Loading..."; GM_xmlhttpRequest({ method: 'GET', url: 'http://preview.tinyurl.com/' + fragment, onload: function(res) { var re = res.responseText.match("<blockquote><b>(.+)</b></blockquote>"); if (re) { link.title = re[1].replace(/\<br \/\>/g, "").replace(/&amp;/g, "&"); } else { link.title = "Parsing failed..."; } }, onerror: function() { link.title = "Connection failed..."; } }); }; var uriPattern = /(tinyurl\.com)\/([a-zA-Z0-9]+)/; var aTags = document.getElementsByTagName("a"); for (i = 0; i < aTags.length; i++) { var data = aTags[i].href.match(uriPattern); if (data != null && data.length > 1 && data[2] != "preview") { var source = data[1]; var fragment = data[2]; var link = aTags[i]; aTags[i].addEventListener("mouseover", function() { if (link.title == "") { (providers[source])(link, fragment); } }, false); } } })(); (The reason the "providers" associative array is set up the way it is, is so that I can expand this to cover other URL-shortening services as well.) I have verified that all the various branches of code are being reached correctly, in cases where the link being examined does and does not match the pattern. What isn't happening, is any change to the "title" attribute of the anchor tags. I've watched this via Firebug, thrown alert() calls in left and right, and it just never changes. In a previous iteration all expressions of the form: link.title = "..."; had originally been: link.setAttribute("title", "..."); That didn't work, either. I'm no newbie to JavaScript OR Greasemonkey, but this one has me stumped!

    Read the article

  • I wrote a new X11 keyboard layout file, how do I get my system to recognize it?

    - by grimborg
    I like to configure my keys my way, so I wrote a keyboard symbols file and I put it in /usr/share/X11/xkb/symbols/cat I use it by running setxkbmap cat -variant dvorak (and it works), but it doesn't show up in the console configuration (dpkg-reconfigure console-setup) nor in the Gnome keyboard settings... nor anywhere else, so I have to run setxkbmap every time. I suppose that I have to register it somewhere, but where? Any hints? Thanks!

    Read the article

  • How can I prevent a field from being copied to the client proxy in WCF RIA?

    - by Martin Doms
    Is there a metadata attribute I can use to prevent a field from being accessible on the client in a WCF RIA services? I sure I have seen this before, but I'm drawing a blank and Google isn't helping. It would look something like [MetadataType(typeof(User.UserMetadata))] public partial class User { internal sealed class UserMetadata { private UserMetadata() { } public int Id { get; set; } [HideFromClientProxy] public string PasswordSalt { get; set; } } }

    Read the article

  • Not able to add column value

    - by peter
    I have project which contain 4 tables among these shedule table Session column i am not able to add vaue,,this table contain three foriegn key from two tables(in which single table has two foreign keys here) i added values here..Any one has any idea about this..Actually my intention is to remove the error "the insert statement conflicted with the foreign key constraint sql server"

    Read the article

  • how to print entire HTML element in JavaScript?

    - by celicni
    I want to print the entire element including tag name, attribute name/value pairs and innerHTML. How can I do it in JavaScript (jQuery)? for example: var elArr = document.getElementsByTagName('link'); alert(elArr[0].printEntireElement()); //expected output might be <link href="/css/common.css" rel="stylesheet" type="text/css">` Note that for link element outerHTML is not defined!

    Read the article

  • How to get attributes from an element in XML

    - by iSight
    I have constructed an XML tree structure of an XML file. I am able to trace the entire tree. When i want to retrieve the attributes of an element, it is returning as NSXMlNode of kind NSXMLAttributeKind. How can i extract the key value pairs in the attribute node.

    Read the article

  • HTML encode on a XSLT

    - by Hugo Palma
    I would like to convert some value from a XML attribute into valid HTML with entities. So that for example the string "olá" from the XML would be transformed from the XSLT into "ol&#225;" I can't find any xsl function to do this. Any ideas ?

    Read the article

  • rais belong_to which class to choose

    - by Small Wolf
    There is a model relation like this. class A belongs_to :ref_config,:class_name => 'User' end My question is : the A has a attribute named flag, now i want to create a function like this: if flag == 1, I want the class A like this belongs_to :ref_config,:class_name => 'Department and if flag == 2, i want the class A like this belongs_to :ref_config,:class_name => 'User' How can I implement the function Thank you!

    Read the article

  • PHP's form bracket trick is to Django's ___?

    - by Matt
    In PHP you can create form elements with names like: category[1] category[2] or even category[junk] category[test] When the form is posted, category is automatically turned into a nice dictionary like: category[1] => "the input value", category[2] => "the other input value" Is there a way to do that in Django? request.POST.getlist isn't quite right, because it simply returns a list, not a dictionary. I need the keys too.

    Read the article

  • Put objects which are decorated with [DataContract] into a StateServer?

    - by Dave
    Is there anyway to stick objects which are decorated with DataContract attributes but not decorated with Serializable attributes in to a SqlServer StateServer? In other words, I would prefer not having to decorate these objects with the Serializable attribute as I will also have to implement IXmlSerizable on all of these objects because they do not have empty contstructors, and non-public setters for properties.

    Read the article

  • Extern variable at specific address

    - by AndiNo
    Using C++ and GCC, can I declare an extern variable that uses a specific address in memory? Something like int key attribute((__at(0x9000))); AFAIK this specific option only works on embedded systems. If there is such an option for use on the x86 platform, how can I use it?

    Read the article

  • What needs to be passed to an editor from a keyboard app to move the cursor one char left?

    - by yno
    What key code does an Android editor app expect the keyboard app to send when it is going to be interpreted as a left arrow? In other words, what is the keyboard program supposed to send to its calling program (some kind of editor) if the user intends to move the cursor one char to the left? A related issue: what do the minus values for the "android:codes" attribute mean? () Any pointers to these issues will be appreciated.

    Read the article

  • How to generate a LONG guid?

    - by Ron
    I would like to generate a long UUID - something like the session key used by gmail. It should be at least 256 chars and no more than 512. It can contain all alpha-numeric chars and a few special chars (the ones below the function keys on the keyboard). Has this been done already or is there a sample out there? C++ or C#

    Read the article

  • How to pickle and unpickle objects with self-references and from a class with slots?

    - by EOL
    Is it possible to pickle an object from a class with slots, when this object references itself through one of its attributes? Here is a simple example: import weakref import pickle class my_class(object): __slots__ = ('an_int', 'ref_to_self', '__weakref__') def __init__(self): self.an_int = 42 self.ref_to_self = weakref.WeakKeyDictionary({self: 1}) # __getstate__ and __setstate__ not defined: how should this be done? if __name__ == '__main__': obj = my_class() # How to make the following work? obj_pickled = pickle.dumps(obj) obj_unpickled = pickle.loads(obj_pickled) # Self-references should be kept: print "OK?", obj_unpickled == obj_unpickled.ref_to_self.keys()[0]

    Read the article

  • @property objective-c sintax

    - by okami
    I'm looking for the sintax of the getter/setter. Which is the setter and which is the getter?? Is the readwrite attribute the getter? Is the assign the setter? @interface SomeClass : NSObject { NSString *str; NSDate *date; } @property (readwrite, assign) NSString *str; @property (readwrite, assign) NSDate *date;

    Read the article

< Previous Page | 223 224 225 226 227 228 229 230 231 232 233 234  | Next Page >