谷歌翻译,有一些书签允许翻译,点击一下,例如:
javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/?text='+t+'&hl=en&langpair=auto|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&hl=en&langpair=auto|en&tbb=1&ie='+e;};
Run Code Online (Sandbox Code Playgroud)
这个javascript代码打开当前页面中的翻译页面(target = _self),但是我希望它打开一个新窗口(tab)进行翻译.所以改为:
javascript:var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){window.open('http://translate.google.com/?text='+t+'&hl=en&langpair=auto|en&tbb=1&ie='+e);}else{window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&hl=en&langpair=auto|en&tbb=1&ie='+e);};
Run Code Online (Sandbox Code Playgroud)
我的问题在于:当我运行该代码时,它会为翻译打开一个新窗口,然后执行此操作; 但非英文页面内容被替换[object Window],但我不想改变原始页面内容......
我能做什么?
谢谢 ..
基本上,程序将被给予一个项目列表,它们必须被分成三个不同的"箱子".把它想象成你正在整理三种颜色的大理石.这些项都是char类型.谢谢您的帮助.
我正在尝试在我的C++代码中实现jsoncpp库,我编写了一段简单的代码来试试它,它甚至都没有编译.
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#ifndef json_included
#define json_included
#include "jsoncpp\include\json\json.h"
#endif
//#include "json\jsonC\json.h"
int main(int argc, char **argv)
{
std::string example = "{\"array\":[\"item1\", \"item2\"], \"not an array\":\"asdf\"}";
Json::Value value;
Json::Reader reader;
bool parsed = reader.parse(example, value, false);
std::cout << parsed;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
undefined reference to `Json::Reader::parse(std::string const&, Json::Value&, bool)'
undefined reference to `Json::Reader::Reader()'
undefined reference to `Json::Value::~Value()'
undefined reference to `Json::Value::Value(Json::ValueType)'
Run Code Online (Sandbox Code Playgroud)
我对C++有点新意,在include语句中有什么我想念的吗?或者jsonCpp需要额外的东西吗?
感谢您的时间!
是否可以下载所有Cocoa API文档?我必须离线工作很多次,有时怀疑会阻止我的所有工作......
我有以下jQuery 确实找到了ASP.NET服务器控件(通过在块中放置一个alert()进行测试),但它没有使用.next()在DOM中的下一个DIV上设置高度.但是,如果我使用直接JS做同样的事情,直接通过ID调用DIV它工作正常.
我想要做的是不使用DIV的硬编码ID以防它改变,而是走DOM以动态地获取元素并设置高度.
所以第一:我试图操纵的HTML源代码:
<div id="WebViewer" style="height:100%;width:100%;margin-right: 0px">
<input name="WebViewerReportReceipt" type="hidden"/>
<input name="WebViewerViewerType" type="hidden"/>
<DIV id="WebViewer_controlDiv">
<iframe src="295769102_1619997395_16141400_2120403583/CacheItem" style="width:100%;height:100%;"></iframe>
</DIV>
</div>
Run Code Online (Sandbox Code Playgroud)
接下来我认为应该工作的非工作jQuery :
//Using the 'DIV' that is created by the viewer (at runtime), resize it dynamically to fit the window
var myHeight = $(window).height();
if ($('#<%=WebViewer.ClientID %>') != null) {
$('#<%=WebViewer.ClientID %>').next('div').height(myHeight - 10);
}
Run Code Online (Sandbox Code Playgroud)
最后一点是,JS 做的工作,但我宁愿不被硬编码ID访问DIV和使用jQuery来代替:
var myHeight = $(window).height();
//Using the 'DIV' that is created by the viewer (at runtime), resize it dynamically …Run Code Online (Sandbox Code Playgroud) 我有个问题.是否可以在剃刀视图中使用AJAX Control Toolkit?我需要使用TabContainer或类似的(它可能是一个HTML Helper)
我知道我可以在aspx中使用它,但我在我的项目中使用Layouts ...所以也许部分视图是解决方案,我真的不知道.
问候.
我正在寻找一种方法来检查Excel工作表当前是否处于活动状态(当前显示).我对同步方法感兴趣,而不是在事件中.
如何在运行时设置crystal report的文本框值.我在crystal report中的section2(页眉)中有一个文本框,现在我必须在运行时设置此文本框的Text属性.基本上我必须在此文本框中传递用户名.
我正在为学校做一个项目,需要对一些数据进行排序.我已经获得了一个对象向量,我必须根据它们的一个属性对对象(就地或使用索引)进行排序.有几个不同的对象和几个不同的属性可以按其排序.这样做的最佳方法是什么?