这些来自php项目的HTML文件中的内容有待更改吗? [英] Anything to be changed in these HTML files coming from php project?

查看:44
本文介绍了这些来自php项目的HTML文件中的内容有待更改吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我目前正在ASP.NET中开发一个站点,并且需要生成JSON.实际上,我正在从php项目中进行迁移.以下是两个.html文件.尽管这些已在php项目中使用,但是在ASP.NET的这些.html文件中是否需要更改某些内容?

Form.html头部

Hi,
I am currently developing a site in ASP.NET and I needed to generate a JSON. Actually, I am migrating this from a php project. Below are two .html files. Although, these wwere being used in php project but is there something that needs to be changed in these .html files for ASP.NET?

Form.html head section

<head>
    <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="json2.js"></script>
    <script type="text/javascript" src="jquery.cookie.js"></script>
    <script type="text/javascript" src="jquery.jsoncookie.js"></script>
    <script type="text/javascript" src="postmessage.js"></script>
    <script type="text/javascript">

    $(function(){
    function getFarfallaPath(){
        var search = 'farfalla_path=';
        if (document.cookie.length > 0) {
            offset = document.cookie.indexOf(search);
            if (offset != -1) {
                offset += search.length;
                end = document.cookie.indexOf(";", offset);
                if (end == -1){
                    end = document.cookie.length;
                }
                return unescape(document.cookie.substring(offset, end))
            }
        }
    }
    //var farfalla_path = 'http://localhost/farfalla/';
    var farfalla_path = getFarfallaPath();
    $('#farfalla_toolbar_form').hide();
    // check if a configuration has already been chosen
        if($.cookie('farfalla_plugins_cookie')){
            window.location = 'toolbar.html?update='+Math.random();
        } else {
    // if not, retrieve the available profiles
        $.getJSON(
            "profiles/index.php/profiles/menu/?callback=?",
            {},
            function(data) {
                $.each(data, function(value, name){
                    $('<option>').attr('value', value).text(name).appendTo('#farfalla_profile');
                });
                $('#farfalla_toolbar_form').show();
            }
            );
        };

        // Recall user's configuration from central db
    $("#farfalla_activator").click(function() {
            var farfalla_profile = $('#farfalla_profile').val();

            $.getJSON(
                "profiles/index.php/profiles/retrieve/"+farfalla_profile+"/?callback=?", {},
// Recall the plugins
                function(data) {
                    $.cookie('farfalla_plugins_cookie', JSON.stringify(data), { path: '/', expires: 10 });
                    $('#farfalla_toolbar_form').fadeOut(1000);
                    pm({
                        target: window.parent,
                        type: "force-reload"
                    });
                }
            );

            // stop the call to the form "action"
            return false;
    });

    });
    </script>
    <style type="text/css" rel="stylesheet">
        body{
            background:#000;
            font-family: Helvetica, Calibri, sans;
            font-size: 12pt;
            color: #fff;
        }
/*      input{
            margin: 3px;
        }
*/
        #farfalla_toolbar_form{
            margin: 3px;
        }
    </style>
</head>



Toolbar.html头部



Toolbar.html head section

<head>
    <link type="text/css" rel="stylesheet" href="farfalla.css" />
    <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="postmessage.js"></script>
    <script type="text/javascript" src="jquery.cookie.js"></script>
    <script type="text/javascript" src="jquery.jsoncookie.js"></script>
    <script type="text/javascript" src="postmessage.js"></script>
    <script type="text/javascript">
    $(function(){

        pm({
            target: window.parent,
            type: "pass-cookie",
            data: $.JSONCookie('farfalla_plugins_cookie')
            });
            $('<ul>').appendTo('#farfalla_active').hide();
            $.each($.JSONCookie('farfalla_plugins_cookie').Plugin, function(i,plugin){
                $('#farfalla_active ul').append('<li>'+plugin.name+'</li>');
            });

            $('#farfalla_active ul').show();
            $('#farfalla_active ul').append('<li><input type="button" id="change_profile" value="change profile" /></li>');
            $('#change_profile').click(
                function(){
                    $.cookie('farfalla_plugins_cookie', null, { path: '/' });
                    window.location = 'form.html';
        });

    });

    </script>
    <style type="text/css" rel="stylesheet">
    body{
            background:#000;
            font-family: Helvetica, Calibri, sans;
            font-size: 12pt;
            color: #fff;
        }
    #farfalla_active{
            margin: 3px;
    }
    </style>
</head>

推荐答案

(function(){ 函数getFarfallaPath(){ var search ='farfalla_path ='; 如果(document.cookie.length> 0){ 偏移量= document.cookie.indexOf(search); if(offset!= -1){ 偏移量+ = search.length; 结束= document.cookie.indexOf(;",偏移量); 如果(结束== -1){ 结束= document.cookie.length; } 返回unescape(document.cookie.substring(offset,end)) } } } //var farfalla_path ='http://localhost/farfalla/'; var farfalla_path = getFarfallaPath();
(function(){ function getFarfallaPath(){ var search = 'farfalla_path='; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1){ end = document.cookie.length; } return unescape(document.cookie.substring(offset, end)) } } } //var farfalla_path = 'http://localhost/farfalla/'; var farfalla_path = getFarfallaPath();


('#farfalla_toolbar_form').hide(); //检查是否已选择配置 if(
('#farfalla_toolbar_form').hide(); // check if a configuration has already been chosen if(


.cookie('farfalla_plugins_cookie')){ window.location ='toolbar.html?update ='+ Math.random(); } 别的 { //如果没有,则检索可用的配置文件
.cookie('farfalla_plugins_cookie')){ window.location = 'toolbar.html?update='+Math.random(); } else { // if not, retrieve the available profiles


这篇关于这些来自php项目的HTML文件中的内容有待更改吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆