Javascript 通过URL向表单传递数据

Javascript 通过URL向表单传递数据,javascript,jquery,forms,twitter-bootstrap,Javascript,Jquery,Forms,Twitter Bootstrap,我正在尝试创建一个非常基本的bookmarklet 我的表单存在于页面上,例如mysite.com/posts/,位于引导模式框中 <div class="post-window"> <div class="window-left"> <textarea name="title_image" class="form-control" rows="3" placeholder="Post title"></textarea>

我正在尝试创建一个非常基本的bookmarklet

我的表单存在于页面上,例如mysite.com/posts/,位于引导模式框中

<div class="post-window">
    <div class="window-left">
        <textarea name="title_image" class="form-control" rows="3" placeholder="Post title"></textarea> 
    <input name="postimage" class="form-control" placeholder="Post image URL" />
    </div>
</div>

<div class="modal-bottom">
    <div class="upload">
    <input type="hidden" name="letsbingo" value="1" />
        <button class="btn-block">Post Selfie</button>
    </div>
</div>
2-上述javascript的结果正是我想要的,如下所示

http://my.com/post/?postimage=%3A%2F%2Fexample.com%2Fwp-content%2Fuploads%2F2013%2F12%2FGripster-Wrap-Mini-For-The-Ipad-Mini-3-690x460.jpg&title_image=Example%20-%20Men%27s%20Gear%2C%20Lifestyle%20and%20Trends
3-现在my.com/post/contians是一段javascripts,它在窗口加载时触发模态框

jQuery(window).load(function ($) {
    jQuery('#postModal').modal('show');
});
bookmarklet正在工作,模式框在窗口加载时打开。但数据并没有传递到表单中。表单在模式框中打开,url已更改,但表单显示为空。我不知道怎么了。模式框在窗口加载时打开的方式错误,或者bookmarklet创建的url不适合这种表单。请给我一点指导。

在显示模式时尝试绑定JS函数。像这样:

$('#postModal').on('show', function () {
    var selfiesite = 'SelfieNow',
    selfiesiteurl = 'http://my.com/post/';
    if (window.selfiesiteit !== undefined) {
        selfiesiteit();
    } else {
        document.body.appendChild(document.createElement('script')).src = 'http://my.com/assets/js/postit.js';
    }

});
$('#postModal').on('show', function () {
    var selfiesite = 'SelfieNow',
    selfiesiteurl = 'http://my.com/post/';
    if (window.selfiesiteit !== undefined) {
        selfiesiteit();
    } else {
        document.body.appendChild(document.createElement('script')).src = 'http://my.com/assets/js/postit.js';
    }

});