Solved

location.href being assigned about:blank in chrome 34

Posted on 2014-04-16
8
414 Views
Last Modified: 2014-04-17
Hello Experts,
For whatever reason I am getting about:blank assigned to my object bill.location.href.

Below is the code Attached are the results in the chrome console. This worked fine prior to the update to chrome 34.console outputconsole output
Any help will be appreciated.

PopulateTab: function (tabHandle, actionUrl, treeQuery) {
        var treeUrl;
        if (actionUrl.substr(0, 7) == "http://" || actionUrl.substr(0, 8) == "https://") {
            treeUrl = "blank.html";
        }
        else {
            treeUrl = "Tree.aspx?AppID=5004&treestate=" + treeQuery;
        }
        try {
            //  this.GetTabActionFrame().location.href = actionUrl; 
            var bill = this.GetTabActionFrame()
            bill.location.href = actionUrl;
       //    this.GetTabActionFrame().location.href = encodeAmpersandInUrl(actionUrl);
        } catch (e) {
            console.log('in poptab');
            console.log(e.stack);
        }
    },

 GetTabActionFrame: function (tabName) {
        if (!tabName) {
            tabName = this.GetSelectedTabName();
        }
        var iFrame = $("#action-" + tabName).get(0);
        var value;
        if (iFrame) {
            value = iFrame.contentWindow;
        }
        return value;
    },

Open in new window

0
Comment
Question by:bill_home
8 Comments
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
And if you change

bill.location.href to bill.location?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
And

bill.location.href = treeUrl;
0
 

Author Comment

by:bill_home
Comment Utility
HJello JulianH and mplungjan,

Location did not work, treeUrl is not what I want to do here:  This worked, anyone who can tell me why gets the points.   ( I changed the var name from bill to tabActionFrame).

 var tabActionFrame = this.GetTabActionFrame();
   setTimeout(function () { tabActionFrame.location.href = encodeAmpersandInUrl(actionUrl); }, 500);
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
Is that the fact that you changed the var name from bill to tabActionFrame or the fact that you waited 500ms before assigning the location that did the trick?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:bill_home
Comment Utility
waited for 500ms did the trick...
0
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
Comment Utility
Can you post all your code - need to see the context of the code block.
0
 

Author Closing Comment

by:bill_home
Comment Utility
very willing to work with me to get a solution.
0
 
LVL 33

Expert Comment

by:Slick812
Comment Utility
greetings bill_home,  since you say - "worked fine prior to the update to chrome 34", and you later say that "waited for 500ms did the trick", , I will give you my opinion about why, a while back , I had to use some slow downs like -
setTimeout(function () { tr1 = changeDiv('div1')}, 200);

Because if I did NOT use the setTimeout( ) then it would NOT work because The page DOM would not yet recognize the New Div I just added as ID 'div1' in JS code, but if I gave the page DOM 100 or 200 ms, then the page DOM would have finished cultivating the new DIV, and a valid reference for ID 'div1' would exist.

I would think that in the new chrome 34, they made some JS implementation faster, so your old code (without the setTimeout ) needed a reference of some sort from a newly created resource, and in older this was there, in newer 34 (maybe faster, maybe slower) the needed reference was not there (a URL it appears) so it goes to the default about page. Not sure about what the encodeAmpersandInUrl( ) does, or is a factor here.

You may not can gain any useful code know how from what I have said, and it's just an opinion, but it is likely this new error for 34 has affected other JS writers, and may be in a web search or two for problems wid chrome 34.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now