English 中文(简体)
Jquery : 从一页转到另一页
原标题:Jquery : To redirect from one page to another page
  • 时间:2012-05-25 06:42:20
  •  标签:
  • jquery
  • html

我在两个不同的地方有两个js页面(来源于.js 和 target.js), 现在我想做的就是当用户点击源页的下调列表时, 它会将用户转向目标页面和反之。 我正向您提供所有位置的准确编码, 以及所有内容, 我只想知道如何从一个页面切换到第二个页面 。

源js 编码

var SourceSc = function() {
var that = {};
var _view = null;
var _childPanel = "#content";
var _sourceDlgMgrC = null;
var BEGIN = "BEGIN";
var STARTING = "STARTING";
var END = "END";
var TARGET = "TARGET";  
var _state = BEGIN;
that.create = function(parent, panel) {

    _parent = parent;
    _panel = panel;
    _transition(STARTING);
};
that.destroy = function() {
    _transition(END);
};
that.eventTargetLanguageView = function() {
    _transition(TARGET_LANGUAGE_VIEW);
};
var _transition = function(newState) {
    _state = newState;
    switch(_state) {                
        case STARTING: _enterStarting(); break;
            case TARGET: _enterTargetDlg(); break;
        case END: _enterEnd(); break;
    }
};
var _enterStarting = function() {
    modelMgr.loadInclude( code/app/sc/LoggedIn/sc/Source/c/SourceDlgMgrC.js , function() {
        modelMgr.getHTML( code/app/sc/LoggedIn/sc/Source/Source.html , function(html) {
            _sourceDlgMgrC = SourceDlgMgrC();
            _sourceDlgMgrC.create(_childPanel);
            var req = {};
            var fnSuccess = function(res) {
                _view = SourceV();
                _view.create(that, _panel, html, res);                  
            };              
        });
    });
};  
var _enterTargetDlg = function() 
{
//now what i have to write here, to load target page
};
var _enterEnd = function() {
     //coding of destroy    
};  
return that;};
var SourceV = function() {
var that = {};

var _sc = null;
var _panel = null;

that.create = function(sc, panel, html, res) {
    _sc = sc;
    _panel = panel;
    that.layoutUi(html);
    that.bindEvents();  
};  
that.layoutUi = function(html) {

    $(_panel).html(html);       
};
that.bindEvents = function() {

    $( #viewList ).change(_sc.eventTargetLanguageView);
};
that.destroy = function() {
    $(_panel).html(  );
    _panel = null;
    _sc = null;
};
return that; };

I can post source. html 完整编码, 但我猜这将会少用一些, 所以我会只发布下拉列表编码 。

    <select id = "viewList" class="fl width160">
            <option>Source</option>
            <option>Target</option>
        </select>

现在目标页面的编码也完全相同,但目标js的位置是“代码/应用程序/sc/LoggedIn/sc/目标/目标/目标js”。

最佳回答

尝试此... (仅举例)

 codeLoadingMgr.loadInclude( path +  /AdminSc.js , function() {
 _adminSc = AdminSc();
  _adminSc.create(that, path, _childPanel,_selectedAdminTab, _programId); 
   });
问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签