Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:14:24+00:00 2026-06-08T02:14:24+00:00

Code snippet: var role=s[0].Role;// role contains string value dijit.byId(editRole).attr(Value,getRoleByName(role)); function getRoleByName(role) { var roleVal;

  • 0

Code snippet:

var role=s[0].Role;// role contains string value 
dijit.byId("editRole").attr("Value",getRoleByName(role));

function getRoleByName(role)
{
    var roleVal;
    alert(role);
    switch(role)
    {
        case 'Basic User' :roleVal='1';break;
        case 'Network Operator' :roleVal='3';break;
        case 'System Administrator' :roleVal='5';break;
        case 'Custom Level 1' :roleVal='11';break;
        case 'Custom Level 2' : roleVal='12';break;
        default: roleVal='1';break;
    }
    return roleVal;
}

When I tried to call the Javascript method which has the switch statement in it I am getting below error in IE8, but in Firefox is working fine..

Error in Developers tools:

method Error executing: function(/*Event*/ e){
    // summary:
    // Handler when the user activates the button portion.
    if(this._onClick(e) === false){ // returning nothing is same as true
        e.preventDefault(); // needed for checkbox
    } else if (this.type == "submit" && !this.focusNode.form){ // see if a nonform widget needs to be signalled
        for(var node=this.domNode; node.parentNode/*#5935*/; node=node.parentNode){
            var widget=dijit.byNode(node);
            if(widget && typeof widget._onSubmit == "function"){
                widget._onSubmit(e);
                break;
            }
        }
    }
}TypeError: Object doesn't support this property or method

Can anyone help me with this? …how to overcome this problem?…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:14:26+00:00Added an answer on June 8, 2026 at 2:14 am

    Error youre showing is not related to the below code. As the dojotoolkit-src commenting kindly shows you is, that it has to do with the function ‘Handler when the user activates the button portion.’

    Should fix this

     // << Value is all lower case
     dijit.byId("editRole").attr("Value",getRoleByName(role)); 
    

    And a little cleaner coded switch with a ‘WTF’ – im thinking it might be the syntax highlighting youre experimenting with here – or are those tildes really in your code?

     // What are these back-tilds doing here?
     switch(role)``  
     {
          case 'Basic User'           : return 1
          case 'Network Operator'     : return 3
          case 'System Administrator' : return 5
          case 'Custom Level 1'       : return 11
          case 'Custom Level 2'       : return 12
          default:
               return 1
         // return works as your break does, it stops the switch
    }
    

    Saying your hitting problem during a trim? Try this, trim is not implemented in all javascript engines

    if(typeof String.prototype.trim !== 'function') {
            String.prototype.trim = function() {
                    return this.replace(/^\s+|\s+$/g, ''); 
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please consider this code snippet: var ul = $(.list_b).find(li).remove().end(); $.each(Sites, function (index, value) {
I'm looking at this code snippet: var addSnippet = function( req, res ) {
So i got this snippet of code: $(document).ready(function () { var replacementDoneIn = $(body).html();
I do not understand this code snippet : function ms(){ var plc=unescape('. unescape( '\x43\x43\x43\x43\n.............\xEF'.
Considering this basic code snippet: <? class mcClassington { var $mcProperty='default'; function mcDoSomething() {
Looking at the following code snippet : public JsonResult GetMapList(string siteDescription,string siteStatus) { var
I have following code snippet in c#. var list = new List<string> { a,
I have following code snippet: var reg = /^[0-9]$/; $('input[type=text]').keypress(function(){ console.log(reg.test(parseInt($(this).val()))); }); When I
I have the following code snippet: $.getJSON(http://localhost:8080/images, function(data) { var items = []; $.each(data,
I have the following code snippet Procedure TFrm.Retrieve(mystring : string); var bs : TStream;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.