?
Solved

location.href being assigned about:blank in chrome 34

Posted on 2014-04-16
8
Medium Priority
?
429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 58

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
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
LVL 58

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 58

Accepted Solution

by:
Julian Hansen earned 2000 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 34

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

764 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