Solved

location.href being assigned about:blank in chrome 34

Posted on 2014-04-16
8
420 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 54

Expert Comment

by:Julian Hansen
ID: 40006132
And if you change

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

Expert Comment

by:Michel Plungjan
ID: 40006143
And

bill.location.href = treeUrl;
0
 

Author Comment

by:bill_home
ID: 40006501
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 54

Expert Comment

by:Julian Hansen
ID: 40006593
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
 

Author Comment

by:bill_home
ID: 40006755
waited for 500ms did the trick...
0
 
LVL 54

Accepted Solution

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

Author Closing Comment

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

Expert Comment

by:Slick812
ID: 40007206
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

776 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