We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5340
    • 1,624 Posts
    HI,

    Can someone explain this line of code

    var c = document.mutate[lastFileCtrl];


    It’s part of the SetUrl function and it should update the content of a text field. In my case c is undefined and the value is not updated and can’t find out why.

    Here’s the full function:
    function SetUrl(url, width, height, alt){
    		
    		    if(lastFileCtrl) {
    			     
    			 
    			     console.log(url);
    			     console.log(lastFileCtrl);
    				
    				var c = document.mutate[lastFileCtrl];
    				
    				console.log(c);
    				
    				
    				if(c) c.value = url;
    				lastFileCtrl = '';
    				
    				
    			} else if(lastImageCtrl) {
    				var c = document.mutate[lastImageCtrl];
    				if(c) c.value = url;
    				lastImageCtrl = '';
    			} else {
    				return;
    			}
    		}


    For some unknown reason console.log(c); is undefined.

    Thanks