Having a problem with document.getElementById in IE 11 to retrive a div  who has a long url as id.   Example :    &lt;div id="http://localhost:8084/group/control_panel/manage?p_auth=2kVqRblu&amp;p_p_id=swcportaluploadData_WAR_swcportaluploadDataportlet&amp;p_p_lifecycle=1&amp;p_p_state=maximized&amp;p_p_mode=view&amp;doAsGroupId=20182&amp;refererPlid=20185&amp;controlPanelCategory=current_site.content&amp;_swcportaluploadData_WAR_swcportaluploadDataportlet_javax.portlet.action=loadCsvData&amp;_swcportaluploadData_WAR_swcportaluploadDataportlet_fileName=CIS_Contact.xlsx"&gt;&lt;/div&gt;   I am getting a null, but the id is unique.  Works as expected on Google Chrome.  Where is the fault ? Special characters?  PS: It works fine for a simple id : &lt;div id="hello"&gt;
14915
When creating the id attributes for HTML elements, what rules are there for the value?
107776
For the following URL, JavaScript breaks:  https://stackoverflow.com/questions/16356382/splitting-a-braces-grouped-string-in-python/16356421?noredirect=1#comment23433042_16356421   This is a link to a , the answer I can see as a 10K+ user (although users &lt;10k ).  With Chrome (26, Mac OS X) the console sez:  Uncaught TypeError: Cannot call method 'replace' of undefined   for line 83 of full.js.  Firefox (20, Mac still), the web console spits out:  [12:48:28.459] TypeError: c.attr(...) is undefined @ http://cdn.sstatic.net/js/full.js?v=c9131e40e3fb:83   Safari (6.0.4 on, you guessed it, Mac OS X) has this to complain about:  TypeError: 'undefined' is not an object (evaluating 'c.attr("id").replace')   for line 83 of full.js.  Because of this, the Answer text box on Stack Overflow is lacking all niceties such as an actual WMD editor.  If you remove the hash reference #comment23433042_16356421 from the end of the URL, things work again. Removing the ?noredirect=1 query parameter makes no difference.
3118
In     ... the number "5000" does not paste as such but instead as  5 0 U+200C U+200B 0 0   The HTML source looks like this:  perhaps the easiest would be &lt;code&gt;\edef\tmp{\everypar{\widowpenalty\the\widowpenalty\relax}}\tmp\widowpenalty=-50&amp;zwnj;&amp;#8203;00&lt;/code&gt; that may reset   Or (smaller snippet):  \widowpenalty=-50&amp;zwnj;&amp;#8203;00&lt;/code&gt; that   So in the HTML, we have extraneous &amp;zwnj; and &amp;#8203; in between the two middle digits of 5000.  Upon pasting and trying out this code, this first led to a mysterious compiler error. The same issue happened within a (now deleted) comment thread below ; there, these or similar two characters were inserted after the letter "r" within the string \ref ("\ref").  Note that not all browsers wrap the same way. The above screenshot was for Firefox 19.0.2, in which it breaks between \relax}} and \tmp, with 5000 insidiously left intact on the second line but with the two special characters remaining in the middle. So that is why this took me completely by surprise. Other browsers might indeed only break on the invisible Unicode characters, such as Chrome 25:    Or on a smaller screen with the mobile site, multiple line breaks might show, possibly still leaving the Unicode characters unused:
82255
I'm making a page which has some interaction provided by javascript. Just as an example: links which send an AJAX request to get the content of articles and then display that data in a div. Obviously in this example, I need each link to store an extra bit of information: the id of the article. The way I've been handling it in case was to put that information in the href link this:  &lt;a class="article" href="#5"&gt;   I then use jQuery to find the a.article elements and attach the appropriate event handler. (don't get too hung up on the usability or semantics here, it's just an example)  Anyway, this method works, but it  a bit, and isn't extensible at all (what happens if the click function has more than one parameter? what if some of those parameters are optional?)  The immediately obvious answer was to use attributes on the element. I mean, that's what they're for, right? (Kind of).  &lt;a articleid="5" href="link/for/non-js-users.html"&gt;   In  I asked if this method was valid, and it turns out that short of defining my own DTD (I don't), then no, it's not valid or reliable. A common response was to put the data into the class attribute (though that might have been because of my poorly-chosen example), but to me, this smells even more. Yes it's technically valid, but it's not a great solution.  Another method I'd used in the past was to actually generate some JS and insert it into the page in a &lt;script&gt; tag, creating a struct which would associate with the object.  var myData = {     link0 : {         articleId : 5,         target : '#showMessage'         // etc...     },     link1 : {         articleId : 13     } };  &lt;a href="..." id="link0"&gt;   But this can be a real pain in butt to maintain and is generally just very messy.  So, to get to the question, how do you store arbitrary pieces of information for HTML tags?
117751
I am trying to runa  query in a .js button to pull out an ID of a contact that is associated with a record so I can auto send an  document.  However I can not get this working, my googling skills have been made defective by this!  Basically I have a button that runs a URL and sends a document to EchoSign to be sent out, but it needs to be sent to the most recent contact that was sent an EchoSign document.  Example below:  var contactCheck = sforce.connection.query("SELECT echosign_dev1__Recipient__c FROM echosign_dev1__SIGN_Agreement__c WHERE echosign_dev1__Account__c = '{!Account.Id}' AND echosign_dev1__Status__c = 'Signed'");   I'm still very new to .js so I am not 100% sure if I am doing things correctly, but I have seen the following 2 ways of pulling out just the ID and neither work:  var contactId = templateId.records[0].Id; var contactId = contactCheck.records[i].get("Id"));   Can anyone help? This is stressing me out... I am going to turn prematurely grey at the age of 22
116915
For a Drupal site, I have written a test script in Selenium IDE that logs in as the administrator, adds a new user and peforms a series of tests on the registration page.  Once this user has been added, I would like to add to this script so that it then goes to the user panel, and removes it again. Getting to the user admin page is simple, and I have the username field stored from earlier, say "test user 2".  In the user admin panel, we have this:    What I need to do is find a way to select the checkbox next to the appropriate user. The problem is that the checkbox is marked up as such:  &lt;input type="checkbox" class="form-checkbox" value="4" id="edit-accounts-4" name="accounts[4]"&gt;   Now, as mentioned before, the only information I have about the user is the username. Unfortunately the id of the checkbox references the internal user id, which is 4. That's information I don't have. However, the username link I can locate because I have the value stored. I can just locate any anchor element containing the username string "test user 2". Markup is:  &lt;a title="View user profile." href="/user/4"&gt;test user 2&lt;/a&gt;   Since I have "test user 2" as the username already stored, I can select this element in my test case. But what I want to do is select the checkbox next to it. There's two ways that I think this can be done:  1) Extract the number "4" from the href attribute and use that to select the checkbox, since all checkbox ids will be of the form "edit-accounts-x" where x is a number.  2) Use some funky xpath to determine that the checkbox is on the same row as the username I have stored.  Thoughts?
24310
I'm trying to get:  document.createElement('div')  //=&gt; true {tagName: 'foobar something'}  //=&gt; false   In my own scripts, I used to just use this since I never needed tagName as a property:  if (!object.tagName) throw ...;   So for the second object, I came up with the following as a quick solution -- which mostly works. ;)  The problem is, it depends on browsers enforcing read-only properties, which not all do.  function isDOM(obj) {   var tag = obj.tagName;   try {     obj.tagName = '';  // Read-only for DOM, should throw exception     obj.tagName = tag; // Restore for normal objects     return false;   } catch (e) {     return true;   } }   Is there a good substitute?
65747
I'm running a REST API which is returning the below:  "id" : "fdgsdgsdsdgsdg",    "pageevents" : [ {        "name" : "test",        "number" : "0123442",        "homepage" : "www.test.com"     } ],     "goals" : [ {        "name" : "test",        "number" : "0123442",        "homepage" : "www.test.com"     } ] } ]   Im using the below code to de-serialize it, so i can display it as a pageblocktable on a visualforce page however im getting the error :      System.JSONException: Illegal value for primitive   public List&lt;maMoments&gt; getMomentsActivity() {     Id contactId;     if (contactId == null) {         contactId = '0030O00001sqXJr';     }      String contactIdString = String.valueOf(contactId);     String jsonResponse = this.AutomationDetailsMoments(contactIdString);     system.debug(jsonResponse);     List&lt;maMoments&gt; mAutomation = (List&lt;maMoments&gt;) JSON.deserialize(jsonResponse, List&lt;maMoments&gt;.class);     system.debug(mAutomation);     for(maMoments emailStructure : mAutomation){      }      return mAutomation; }  public string AutomationDetailsMoments(String contactId) {     contactId = '0030O00001sqXJr';     Http h = new Http();     HttpRequest req = new HttpRequest();     req.setEndpoint('https://virtserver.swaggerhub.com/mickjdavies/Example/1.0.0/interestingmoments');     req.setMethod('POST');     req.setBody(contactId);      // Send the request, and return a response     HttpResponse res = h.send(req);     system.debug(res.getBody());     return res.getBody(); }  private class maMoments {     public String contactId;     public String id;     public List&lt;String&gt; goals;     public String name;     public String homepage;     public String phone; }
70194
We have a custom javascript button on the quotes object in our org that has been working for several months that someone has noticed today is not working.    I'm not sure if there was an update that broke it or what day exactly it stopped working.  I'm hoping someone has an idea of where I can even begin to look.   Here's the code:   javascript:location.href= 'mailto:emailaddress@ourdomain.com?SUBJECT='+ escape("{!Quote.Name}")+' - '+ escape("{!Quote.Contact_s_Account__c}") + '&amp;BODY=Please convert ' + escape(location.href)+ ' into a proposal and send it to the email address on the quote.  Thanks!';   Using developer tools in chrome, I see this error after I click the javascript button:   presence: onFailure in event parser ={"status":-5,"statusText":""}page load happens value=true           umps1w4.salesforce.com/umps/UMPSWidget_184/js/dist/umps-min.js?cflag=184.36:14 presence: onFailure in event parser ={"status":-5,"statusText":""}page load happens value=true   I changed my code to something simple:   javascript:location.href= 'mailto:emailaddress@ourdomain.com?SUBJECT='hello'    and got this error in the developer tools in chrome:   Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.   This lead me to the conclusion that I'm having XSS issues.  I do remember a SF update not too long about about protecting against XSS issues.  I guess I'll have to figure out a different way to implement this functionality.
621
How to Handle Dynamic Changing IDs In XPath? for example :   //div[@id='post-body-3647323225296998740']/div[1]/form[1]/input[1]   In this xpath id "3647323225296998740" is changing every time when reloading the page.   Is there any way to handle this type of situation in Selenium?
6322
I'm using Drupal v7.22 and whenever I try to Modify the Display on views, and press the 'Add and configure' button on adding a field, or any button that sends data to the server, the page reloads and I just get a long JSON String returned in Chrome, or IE will try to download the return...  Sometimes it'll accept my change, but more often than not, it won't.  It was doing this on 7.21 and then I updated to 7.22 and it stopped for a day or two, now it's doing it again.  I am extremely new to Drupal, but I am a quick learner and most things are going smoothly.  What did I break and how can I fix it?
124016
I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL. Ideally I would like to be able to load the iframes current url into a textbox with javascript. I realize now that this is not going to happen due to security issues.  Has anyone done anything on the server side? or know of any .Net browser in browser controls. The ultimate goal is to just give the user an easy method of extracting the url of the page they are viewing in the iframe It doesn't necessarily HAVE to be an iframe, a browser in the browser would be ideal.  Thanks, Adam
30966
I understand that an id must be unique within an HTML/XHTML page.  My question is, for a given element, can I assign multiple ids to it?  &lt;div id="nested_element_123 task_123"&gt;&lt;/div&gt;   I realize I have an easy solution with simply using a class. I'm just curious about using ids in this manner.
112425
I want to get the URL for my site collection. One way I thought I could do it was using the window.location in javascript and getting it that way.   I know that you can use ECMA script and the client object model to do this but unsure how.  I have tried:  var context = new SP.ClientContext; alert(context.get_url());   This is returning /  How would I get it to include the full URL? i.e. http://mysharepoint:29292/
79949
When I upload a file to a site using the ASP:File control the FileName property is different in IE and Firefox.  In Firefox, it just provides the name of the file, but IE provides the full path to the file.  I have worked around this by adding the code:  Dim FileName As String = file.FileName If FileName.LastIndexOf("\") &gt; 0 Then     FileName = FileName.Substring(FileName.LastIndexOf("\") + 1) End If   But I'm not sure why that would be different between the different browsers.  Does anyone know the reason for this?  Thanks.
8126
Something like .//div[@id='foo\d+] to capture div tags with id='foo123'.  I'm using .NET, if that matters.
109984
It appears that when a user image can't be displayed, the user in the Users List on the right side of the HNQ page gets a scrollbar:    Looking at , it looks like the link for the image it's trying to pull is:  https://graph.facebook.com/1562342057384865/picture?type=large   For me at least, visiting that page results in:  {    "error": {       "message": "Unsupported get request. Object with ID '1562342057384865' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",       "type": "GraphMethodException",       "code": 100,       "error_subcode": 33,       "fbtrace_id": "DGmWtgYaB0R"    } }   I'm using Chrome Version 72.0.3626.121 (Official Build) (64-bit) on a Windows 10 machine.  Can we handle this better to avoid the strange scrollbar?