脚本加载后隐藏文本

时间:2017-03-22 21:08:13

标签: html

如何在加载时将Spritz框移动到页面顶部?或者,在Spritz获取文本后如何从页面中删除所有文本?而且,我怎样才能使访问该页面的任何人都可以上传.txt文件供Spritz阅读?

我试图用HTML编写一个非常简单的网页,但我遇到了一些问题。

我尝试做的最终结果是,当我的页面完成加载时,除了Spritz Box(参见下面的代码)之外什么也没有显示,我想开始显示书中的文字(再次,见下面的代码。)

我遇到的问题是文本在页面上占用了太多空间(在这里谈论了几十万字,为了这个问题我删除了一堆)。这会导致Spritz出现的区域出现问题(通常位于大量文本页面的底部)。

<!DOCTYPE html>
</style>
<div id="bodyContent" class="mw-body-content">
<font size="0">                        
The Magicians - Lev Grossman
BOOK I
BROOKLYN
Quentin did a magic trick. Nobody noticed.
They picked their way along the cold, uneven sidewalk together: James, Julia, and Quentin. James and Julia held hands. That’s how things were now. The sidewalk wasn’t quite wide enough, so Quentin trailed after them, like a sulky child. He would rather have been alone with Julia, or just alone period, but you couldn’t have everything. Or at least the available evidence pointed overwhelmingly to that conclusion.
“Okay!” James said over his shoulder. “Q. Let’s talk strategy.”
James seemed to have a sixth sense for when Quentin was starting to feel sorry for himself. Quentin’s interview was in seven minutes. James was right after him.
“Nice firm handshake. Lots of eye contact. Then when he’s feeling comfortable, you hit him with a chair and I’ll break his password and e-mail Princeton.”
“Just be yourself, Q,” Julia said.
Her dark hair was pulled back in a wavy bunch. Somehow it made it worse that she was always so nice to him.
“How is that different from what I said?”
Quentin did the magic trick again. It was a very small trick, a basic one-handed sleight with a nickel. He did it in his coat pocket where nobody could see. He did it again, then he did it backward.
“I have one guess for his password,” James said. “Password.”
It was kind of incredible how long this had been going on, Quentin thought. They were only seventeen, but he felt like he’d known James and Julia forever. The school systems in Brooklyn sorted out the gifted ones and shoved them together, then separated the ridiculously brilliant ones from the merely gifted ones and shoved them together, and as a result they’d been bumping into each other in the same speaking contests and regional Latin exams and tiny, specially convened ultra-advanced math classes since elementary school. The nerdiest of the nerds. By now, their senior year, Quentin knew James and Julia better than he knew anybody else in the world, not excluding his parents, and they knew him. Everybody knew what everybody else was going to say before they said it. Everybody who was going to sleep with anybody else had already done it. Julia—pale, freckled, dreamy Julia, who played the oboe and knew even more physics than he did—was never going to sleep with Quentin.
Quentin was thin and tall, though he habitually hunched his shoulders in a vain attempt to brace himself against whatever blow was coming from the heavens, and which would logically hit the tall people first. His shoulder-length hair was freezing in clumps. He should have stuck around to dry it after gym, especially with his interview today, but for some reason—maybe he was in a self-sabotaging mood—he hadn’t. The low gray sky threatened snow. It seemed to Quentin like the world was offering up special little tableaux of misery just for him: crows perched on power lines, stepped-in dog shit, windblown trash, the corpses of innumerable wet oak leaves being desecrated in innumerable ways by innumerable vehicles and pedestrians.
“God, I’m full,” James said. “I ate too much. Why do I always eat too much?”
</font> 
</div>
<script type="text/javascript">
    // Javascript URL redirection
      window.location.replace("javascript:(function(){function%20loadScript()%7Bvar%20script=document.createElement(%27script%27);script.setAttribute(%27type%27,%27text/javascript%27);script.setAttribute(%27charset%27,%27UTF-8%27);script.setAttribute(%27async%27,%27true%27);script.setAttribute(%27src%27,%27https://sdk.spritzinc.com/js/1.2/bookmarklet/js/SpritzletOuter.js%3F%27+(new%20Date().getTime()).toString().substring(0,7));document.documentElement.appendChild(script);script.onload=script.onreadystatechange=function()%7Bvar%20rs=script.readyState;if(!rs%20||%20rs===%27loaded%27%20||%20rs===%27complete%27)%7Bscript.onload=script.onreadystatechange=null;Spritzlet.init();}};}if(window.Spritzlet)%7BSpritzlet.activate();}else%7Bwindow.Spritzlet=window.Spritzlet%20||%7B};window.Spritzlet=%7Borigin:window.location.protocol+%27//%27+window.location.host,loaderVersion:1.0};loadScript();}})();");
</script>

1 个答案:

答案 0 :(得分:1)

你希望spritz窗口显示在页面顶部,你可以隐藏文本,我做对了吗?如果是这样,只需使用css display: none隐藏文字就可以了,check this out