小编Lap*_*ies的帖子

IE8/9中的FormData

我已经实现了这个脚本用于上传带有ajax的文件,它在浏览器以外的其他浏览器中工作得很完美,我注意到IE9不支持formData,更少,IE中的formData有什么替代品,我想用干净的javascript

    function doObjUploadExplorer(url, lnk_id, file, progress, success, content, frm, div_dlg, start_func){
    var file_input = null,
      frm_data = new FormData(),
      req;

    try {
        //firefox, chrome, safari etc
        req = new XMLHttpRequest();
    }

    catch (e) {
        // Internet Explorer Browsers
        req = new ActiveXObject("Microsoft.XMLHTTP");
    }


if (document.getElementById(file)) {
    file_input = document.getElementById(file);

    for (var i = 0; i < file_input.files.length; ++i) {
        frm_data.append(file, file_input.files[i]);
    }
}

req.upload.addEventListener('progress', function(e) {  //Event called while upload is in progress
    if (progress !== undefined
            && e.lengthComputable) { …
Run Code Online (Sandbox Code Playgroud)

javascript xmlhttprequest form-data activexobject

19
推荐指数
1
解决办法
8万
查看次数

在邮件正文phpmailer类中添加嵌入图像

我试图在我的邮件正文中嵌入一个图像,但它最终成为一个附件

    $mailer->Subject = APP_NAME . " - " . $name . " send you and Ad : " . $row['name'];
    $mailer->IsHTML(true);
    $mailer->AddEmbeddedImage('../images/namDiams.png', 'logoimg', 'namDimes.png'); 

    //footer
    $footer = "Regards<br/><br/>";
    $footer .= '<table style="width: 95%">';
    $footer .= '<tr>';
    $footer .= '<td>';
    $footer .= "<strong><span style='font-size: 15px'>NamDimes Team</span></strong><br/>
                    NamDimes<br/>
                    Contact Number: " . APP_CONTACT . "<br/>
                    Email: " . APP_EMAIL . "<br/>
                    Website: " . APP_WEBSITE . "<br/>";
    $footer .= '</td>';
    $footer .= '<td style="text-align:right">';
    $footer .= '<img src=\"cid:logoimg\" />';
    $footer .= '</td>'; …
Run Code Online (Sandbox Code Playgroud)

html php phpmailer

3
推荐指数
1
解决办法
2万
查看次数

多个访问者可以共享相同的IP地址吗?

是否有可能在访问我的网站时同时存在两个设备的重复IP地址?这就是我获取IP地址的方式

$_SERVER['REMOTE_ADDR']
Run Code Online (Sandbox Code Playgroud)

php ip-address

3
推荐指数
1
解决办法
257
查看次数

使用更短的名称来访问 C# 中的类

只是需要一些建议,因为我对此很陌生。有什么办法可以缩短这个时间吗?

 Student.Classes.Enum.Enum.gender
Run Code Online (Sandbox Code Playgroud)

只是需要一种更聪明的方法来做到这一点。

c# asp.net

2
推荐指数
1
解决办法
85
查看次数

在ajax加载时创建加载图像

这是我的代码.我正在尝试插入一个图像来显示ajax正在加载,但我无法做到这一点; 我尝试了很多可能的方法,但它只是不起作用.有关该怎么办的任何建议?

ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
        var ajaxDisplay = document.getElementById('main_result');
        ajaxDisplay.innerHTML = ajaxRequest.responseText;
    }
}
$("#main_result").empty().html('<img src="loading.gif" />');

var category = document.getElementById('category').value;
var brand = document.getElementById('brand').value;
var item = document.getElementById('item').value;
var queryString = "&category=" + category + "&brand="+ brand +"&item="+ item;
ajaxRequest.open("GET", "main_search_special.php?section=special" + queryString, true);
ajaxRequest.send(null);
Run Code Online (Sandbox Code Playgroud)

html javascript php ajax

1
推荐指数
1
解决办法
5156
查看次数

仅在java中使用密码加密以字符串字符加密

我有一段代码在加密时工作正常,加密有效,但我不喜欢加密字符串中使用的字符,因为它必须在URL中传递,我更喜欢的字符是az,AZ和0-9,这可能吗?

String key = enc_key;

// Create key and cipher
Key aesKey = new SecretKeySpec(key.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES");

// encrypt the text
cipher.init(Cipher.ENCRYPT_MODE, aesKey);
byte[] encrypted = cipher.doFinal(text.getBytes());
System.out.println(new String(encrypted));
Run Code Online (Sandbox Code Playgroud)

加密的字符串看起来像这个 ò'Ê>‡6?dövNé÷s 这不是URL友好的:-(,有什么建议吗?

java encryption

1
推荐指数
1
解决办法
630
查看次数

在jqPlot中格式化Y轴编号

我设法将我的y轴文本格式化为两位小数,但由于我使用的是非常大的数字,有没有办法可以显示我的数字,如:

NAD 100,000,000.00
Run Code Online (Sandbox Code Playgroud)

而不是

NAD 100000000.00
Run Code Online (Sandbox Code Playgroud)

通过使用刻度选项

yaxis: { 
           tickOptions:{formatString:'NAD %.2f'} 
        } 
Run Code Online (Sandbox Code Playgroud)

javascript jquery jqplot

0
推荐指数
1
解决办法
3943
查看次数