zoukankan      html  css  js  c++  java
  • 关于frameset中指定区域回退的实现

    指定区域(Frame)的回退,网上大都写的是用  window.parent.window.mainFrame.rightFrame.history.back();来进行回退,但是我这边就是不行,一直退到欢迎界面了还能往后退 ,知道腿到登录界面了,用了个另类的解决办法

     function back() {
                var CurrentUrl = window.parent.window.mainFrame.rightFrame.location.href;
                if (CurrentUrl != undefined && CurrentUrl != "") {
                    var strs = CurrentUrl.split('/');
                    if (strs != undefined && strs != null) {
                        if (strs[strs.length - 1] == "Default.aspx") {
                            return;
                        }
                        else {
                            window.parent.window.mainFrame.rightFrame.history.back();
                        }
                    }
                }
            }

    通过获取需要回退区域加载的url界面的名称与欢迎界面进行比较,这样来解决退回到登录界面的问题。

    还有很多界面都有首页的超链接,也是到Default.apsx界面的,这样回退的时候就会被打断,这时我们需要做的是给欢迎界面加上个随机数

     <a href="Default.aspx?Math.random()" target="rightFrame">首页 </a>

    一起到判断的效果。

    这些是我遇到的一些问题,很久没有写b/s代码了,不足之处欢迎指出,或者是能够提供更好的方法。

  • 相关阅读:
    2. Add Two Numbers
    1. Two Sum
    22. Generate Parentheses (backTracking)
    21. Merge Two Sorted Lists
    20. Valid Parentheses (Stack)
    19. Remove Nth Node From End of List
    18. 4Sum (通用算法 nSum)
    17. Letter Combinations of a Phone Number (backtracking)
    LeetCode SQL: Combine Two Tables
    LeetCode SQL:Employees Earning More Than Their Managers
  • 原文地址:https://www.cnblogs.com/fxf568/p/3361376.html
Copyright © 2011-2022 走看看