JavaScriptµ¼³öexcel word¡¡
ÕâÀï ÊÇÈýÖÖµ¼³ö£¬ÍøÉÏËѵģ¬excelµ¼³ö»¹ÐУ¬word¾Í²»ºÃÁË£¬²»ÊÇÎÒÏëÒªµÄÄÇÖÖ£¬µ«ÊÇ»¹ÊÇÌù³öÀ´ÁË ºÙºÙ£¬Ï£ÍûÓиüºÃµÄ ¸æËßÎÒÏ лл£¬ÕâÀïµÄwordµ¼³öʱÀûÓø´ÖÆð¤ÌùÔÀí£¬¸Ð¾õºÜ²»ºÃ£¬ÓÐÒ»ÖÖµ¼³öexcelÒ²ÊÇÈç´Ë£¬ÕâÀﻹÓе¼³ö±í¸ñÐÅÏ¢µÄ£¬²»ÊǸ´ÖÆð¤Ìù%
<script language="javascript">
/**//*
*
* @param {Object} cont Òªµ¼³öµÄhtmlÔªËØÄÚÈݵÄid,×¢Òâ²»Òª¼ÓË«ÒýºÅ
* @param {Object} key ·ÖÒ³¹Ø¼ü×Ö
*/
function AllAreaWord(cont,key)
{
var oWD = new ActiveXObject("Word.Application");
//ĬÈÏΪҳÃæÊÓͼ
var oDC = oWD.Documents.Add("", 0, 0);
var oRange = oDC.Range(0, 1);
//var oRange1 = oDC.Range(0,2);
var sel = document.body.createTextRange();
//²ÎÊýΪhtmlÔªËØid
sel.moveToElementText(cont);
sel.select();
sel.execCommand("Copy");
oRange.Paste();
oWD.Application.Visible = true;
//µÃµ½´ò¿ªºówordµÄselection¶ÔÏó
var selection = oWD.Selection;
//ÉèÖÃ×ÖÌå´óС
selection.Font.Size = 10;
//ctrl+A È«Ñ¡²Ù×÷
selection.WholeStory();
&nbs
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
ѧϰÁ˽âÁËjavascriptµÄһЩԪËضÔÏóµÄ´´½¨£¬»ñÈ¡µÈ¡£ÏÖÔÚµÄѧϰÖ÷ÒªÊÇÉæ¼°ÔÚ±àдjavascriptµ±ÖÐÓ¦¸Ã×¢ÒâµÄһЩϸ½Ú£º
1 ×¢Òâ±äÁ¿µÄ±àдÕýÈ·
2 ²ÎÊý´«µÝ³öÏÖÎÊÌâ »òÕß²»´æÔÚÒ²»áµ¼Ö³ö´í
3 js´íÎóµÄ¿ØÖƺ¯Êý window.onerror£ºÆ佫»á´øÈý¸ö²ÎÊýÐÅÏ¢ ¿Éͨ¹ý²ÎÊýÊý×é arguments »ñÈ¡ÐÅÏ¢ ´íÎóÐÅÏ¢£¬´íÎóÒ³ÃæµÄurlºÍ´í ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head ru ......
ÎÒÃÇ¿ÉÒÔʹÓà JavaScript À´´´½¨¶¯Ì¬µÄͼÏñ¡£
ʵÀý
°´Å¥¶¯»
ÀûÓÃÁ½¸ö²»Í¬µÄʼþÀ´Çý¶¯Á½¸öÏàÓ¦µÄº¯Êý£¬À´Çл»Á½ÕŶÔÓ¦µÄͼƬÒÔ´´Ôì³ö¶¯»Ð§¹û¡£
JavaScript ¶¯»
ʹÓà JavaScript ´´½¨¶¯Ì¬Í¼ÏñÊÇ¿ÉÐеġ£
ÇÏÃÅ
ÊÇ£ºÊ¹Óà JavaScript ͨ¹ý²»Í¬µÄʼþÀ´Çл»²»Í¬µÄͼÏñ¡£
ÔÚÏÂÃæµÄÀý×ÓÖУ¬ÎÒÃÇÒªÖÆ×÷Ò»¸ö³äµ±Á ......
function object2String(obj)
{
var val, output = "";
if (obj)
{
output += "{";
for (var i in obj)
{
val = obj[i];
switch (typeof val)
{
case ("object"):if (val[0]){output += i + ":" + array2String(val) + &qu ......