Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Dojo syntax issue

    I am new to Dojo and tyrign out some code below. I am getting a syntax issue on line 9:

    "a"{

    Full code:
    Code:
    //Auto Download Tracking
    /*Regex list of download file extensions, pipe and backslash delimited. Looks for the period before the file type so it will work on download links with query parameters after it */
    var downloadTypes = /\.pdf|\.doc|\.xls|\.zip|\.csv|\.ppt|\.rtf|\.pptx|\.docx|\.xlsx|\.wmv|\.mpg|\.mov|\.avi|\.exe|\.mp3|\.wma|\.txt|\.rar|\.wav/i; 
    
    /*Regex list of on-site domains, pipe and backslash delimited. */
    var onsiteDomains = /bluecrossma\.|ahealthyme\.|livinghealthybabies\.|paramisalud\.|whygetit\.|indigo-insurance\.|healthy-actions\.|javascript|#/i;
    
    dojo.behavior.add({
    	"a"{
    		onclick:function(dom){
    			if( dom.href.match(downloadTypes) )
    			ntptEventTag('ev=download&eventPage=Download From: ' + escape( wa.currentDomain + wa.currentURL ) + '&downloadFile=' + escape( dom )); 
    			
    			if(!dom.href.match(onsiteDomains) )
    			ntptEventTag('lk=1&ev=Exit Link&eventPage=Exited From: ' + escape( wa.currentDomain + wa.currentURL ) + '&exitTo=' + escape(dom)); 
    		};
    	}
    });
    dojo.behavior.apply();
    Is there a simple fix for this?

    Thanks!

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    I think you are missing a colon:

    "a" : {
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •