热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

将文本插入TumblrAskBox-InsertTextIntoTumblrAskBox

Doesanyoneknowiftheresawaytoaddtextintothetumblraskboxwhenthepageisfirstloaded?

Does anyone know if there's a way to add text into the tumblr ask box when the page is first loaded? I'm running a blog where people can ask for advice from either a girl or a guy. I want them to click a link and go to the ask page but then depending on the link they clicked, #AskHim or #AskHer will be pre-added into the ask box. Without these "tags" (just basic text), all questions come to my inbox and I have no idea what perspective (guy or girl) they want their question answered from.

有人知道在首次加载页面时是否有办法在tumblr问题框中添加文本?我正在运行一个博客,人们可以向女孩或男人寻求建议。我希望他们点击一个链接然后转到问题页面,然后根据他们点击的链接,#AskHim或#AskHer将被预先添加到问题框中。没有这些“标签”(只是基本文本),所有问题都会进入我的收件箱,我不知道他们希望从哪个角度(男人或女孩)回答问题。

HTML:

CSS:

#askbox {
   margin: 10px auto;
   width:600px;
}

I've found topics on how to insert text into a text box using Javascript. However, tumblr has it's own built in tagging/html system so I'm not sure if this is even possible.

我找到了有关如何使用Javascript将文本插入文本框的主题。但是,tumblr有自己内置的标记/ html系统,所以我不确定这是否可行。

i.e.


Also, here is a link to my blog (Main Blog). The user will click either the "Ask Her" or "Ask Him" image links on the left side of my blog.

此外,这是我的博客(主博客)的链接。用户将单击我博客左侧的“询问她”或“询问他”图像链接。

links on my blog

Then this will take them to my ask page where I want the text to be inserted into the ask box (Ask Page).

然后,这将把他们带到我的询问页面,我希望将文本插入询问框(Ask Page)。

example of text added to ask box

Thanks in advance for any advice you can give!

提前感谢您提出的任何建议!

1 个解决方案

#1


The only way I can think of achieving this off the top of my head is by using the placeholder attribute.

我能想到实现这一目标的唯一方法是使用占位符属性。

However, I'm not sure you'd be able to manipulate the main text area, since Tumblr utilizes iframes for customized ask pages.

但是,我不确定您是否能够操纵主要文本区域,因为Tumblr使用iframe来定制问题页面。


推荐阅读
author-avatar
陈先森的记忆
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有