gpt4 book ai didi

javascript - HTML 表单操作是前置值而不是附加值

转载 作者:行者123 更新时间:2023-12-03 10:54:02 24 4
gpt4 key购买 nike

我有以下表格。我希望网址为:http://myapp/library/#/iframe?title=Search&url=http:%2F%2Fencore.scranton.edu%2Fiii%2Fencore%2Fsearch%2F?lang=eng&target=Einstein

<form action="#/iframe?title=Search&url=http://encore.scranton.edu/iii/encore/search/" id="form" method="get" name="form" >
<input name="target" type="search" value="" placeholder="Search" class="search-input">
</form>

但它的前缀是:http://myapp/library/?target=Einstein#/iframe?title=Search&url=http:%2F%2Fencore.scranton.edu%2Fiii%2Fencore%2Fsearch%2F?lang=eng

Angular 代码:

iframe/templates/index.html

<div ui-view class="container">
....
<div class="animated fadeIn iframe">
<iframe src="{{ url }}" frameborder="0"></iframe>
</div>
</div>

iframe/controller.js

        //
// Routes
//
.state('iframe', {
url : '/iframe?title&url',
templateUrl : 'modules/Iframe/templates/index.html',
controller : 'IframeController'
})
}]);

最佳答案

如果没有看到 JS,我可能会在黑暗中跳舞,但是你尝试过这样的事情吗?

假设没有框架

var myform = document.getElementById("form");
var action = myform.getAttribute("action");
//reset the entire attribute
myform.setAttribute(action+"value_i_want_appended");

关于javascript - HTML 表单操作是前置值而不是附加值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28331016/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com