I'm using jquery nestable to create a list of academic programs a prospective student might be interested in. 16 programs pulled from mysql and listed like this: <ol class="dd-list"> if(mysqli_num_rows($result)) { $order = array(); while($item = mysqli_fetch_assoc($result)) { echo '<li class="dd-item" data-id="'.$item['id'].'"><div class="dd-handle">',$item
我正在使用jquery nestable来创建一个潜在学生可能感兴趣的学术课程列表。从MySQL中取出16个程序并列出如下: <ol class="dd-list"> if(mysqli_num_rows($result)) { $order = array(); while($item = mysqli_fetch_assoc($result)) { echo '<li class="dd-item" data-id="'.$item['id'].'"><div class="dd-handle">',$item['program'],'</div></li>'; } </ol> }
I have a React App, I need to make an ajax call (in order to learn) to a online service (async) with Redux. This is my store: import { createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import duedates from './reducers/duedates' export default applyMiddleware(thunk)(createStore)(duedates); This is the actions: import rest from '../Utils/rest'; export function ge
我有一个React应用程序,我需要使用Redux进行ajax调用(以学习)到在线服务(异步)。 这是我的商店: import { createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import duedates from './reducers/duedates' export default applyMiddleware(thunk)(createStore)(duedates); 这是行动: import rest from '../Utils/rest'; export function getDueDatesOptimistic(dueDates){ conso
I'm new to React/Redux. I use a fetch api middleware in Redux app to process the APIs. It's https://github.com/agraboso/redux-api-middleware. I think it's the good way to process async api actions. But I find some cases which can't be resolve by myself. As the homepage https://github.com/agraboso/redux-api-middleware#lifecycle say, a fetch API lifecycle begins with dispatchi
我是React / Redux的新手。 我在Redux应用程序中使用fetch api中间件来处理这些API。 它是https://github.com/agraboso/redux-api-middleware。 我认为这是处理异步API行为的好方法。 但是我发现了一些我自己无法解决的情况。 正如主页https://github.com/agraboso/redux-api-middleware#lifecycle所言,抓取API生命周期始于调度CALL_API操作,并以调度FSA操作结束。 所以我的第一个案例是在提取API时显示/隐藏预加载器
There is a lot of talk about the latest kid in redux town right now, redux-saga/redux-saga. It uses generator functions for listening to/dispatching actions. Before I wrap my head around it, I would like to know the pros/cons of using redux-saga instead of the approach below where I'm using redux-thunk with async/await. A component might look like this, dispatch actions like usual. impo
现在有很多人在谈论最新的孩子,REDX-SAGA / REDX-SAGA。 它使用生成器函数来监听/分派操作。 在我将头围绕在它上面之前,我想知道使用redux-saga优缺点,而不是下面的方法,我使用redux-thunk是异步/等待的redux-thunk 。 一个组件可能看起来像这样,像往常一样调度操作。 import { login } from 'redux/auth'; class LoginForm extends Component { onClick(e) { e.preventDefault(); const { user, pass } =
I have an action that updates notification state of my application. Usually, this notification will be an error or info of some sort. I need to then dispatch another action after 5 seconds that will return the notification state to initial one, so no notification. The main reason behind this is to provide functionality where notifications disappear automatically after 5 seconds. I had no luc
我有一个更新我的应用程序通知状态的操作。 通常,此通知将是某种错误或信息。 然后我需要在5秒后发送另一个动作,它会将通知状态返回到初始状态,所以没有通知。 这背后的主要原因是提供5秒钟后通知自动消失的功能。 我没有使用setTimeout并返回另一个操作的运气,并且无法找到这是如何在线完成的。 所以任何建议都是值得欢迎 不要陷入图书馆应该规定如何去做所有事情的陷阱。 如果你想在JavaScript中使用超时,你需要
I was browsing around and I found this: var i, len; for(i = 0, len = array.length; i < len; i++) { //... } My first thoughts are: Why he did that? (it must be better for some reason) Is it worth it? (I assume yes, why else he will do it this way?) Do normal loops (the ones that don't cache the length) check the array.length each time? A loop consisting of three parts is ex
我正在浏览,我发现这一点: var i, len; for(i = 0, len = array.length; i < len; i++) { //... } 我的第一个想法是: 他为什么这么做? (由于某种原因,它一定会更好) 这值得么? (我想是的,为什么他会这样做?) 做正常的循环(那些不缓存长度的循环)每次检查array.length ? 由三部分组成的循环执行如下: for (A; B; C) A - Executed before the enumeration B - condition to test C - express
I'm developing an extension that, sometimes, will show some websites inside iframes. I've already bypassed the X-FRAME-OPTIONS issue but now I'm stuck with the simple iframe buster code, eg.: if (top != self) { document.getElementsByTagName("html")[0].style.display = "none"; top.location.replace(location); } I'm trying to inject javascript at the very top of the page to o
我正在开发一个扩展,有时会在iframe中显示一些网站。 我已经绕过了X-FRAME-OPTIONS问题,但现在我坚持使用简单的iframe解决方案代码,例如: if (top != self) { document.getElementsByTagName("html")[0].style.display = "none"; top.location.replace(location); } 我试图在页面顶部注入JavaScript以覆盖window.top对象,但是在document_start注入它已经太迟了,也就是说,在buster脚本运行之前从不会调用alert()
I'm trying to find a way to stop malicious ad IFrames from stealing top.location as they sometimes do (cheap traffic). I used Atwood's HTTP 204 solution but in my tests seems like it breaks some basic functionality like manually changing the url via address bar and the refresh button busted as well. I thought I might be able to stop the bubbling of onbeforeunload event and use the bus
我试图找到一种方法来阻止恶意广告IFrame从他们有时候盗取top.location(廉价流量)。 我使用了Atwood的HTTP 204解决方案,但在我的测试中,似乎它破坏了一些基本功能,例如手动通过地址栏更改网址以及刷新按钮。 我认为我可以停止onbeforeunload事件的冒泡,并使用“中间”IFrame内的破解代码,但我无法做到这一点,“中”IFrame中的onbeforeunload事件触发和破坏任何重定向尝试。 我想知道,有没有其他方法可以保持功能的正
I'm displaying my outbound links with a header from my site, some of my data providers have frame busters in place. What I'm trying to accomplish is; if no frame busting is in place (content loaded successfully), then show the frame, else if frame busting is in place, just refresh the entire page with what would have been the frame source? I've seen a few posts about it, and most
我使用我网站的标题显示我的出站链接,我的一些数据提供商有框架编排器。 我试图完成的是; 如果没有帧破坏(内容加载成功),然后显示帧,否则如果帧破坏已到位,只刷新整个页面的帧源? 我看过几篇关于它的文章,大部分代码都需要用户交互,比如: var prevent_bust = 0 window.onbeforeunload = function() { prevent_bust++ } setInterval(function() { if (prevent_bust > 0) { prevent_bust -= 2
So on my site I load a webpage in an iframe, and some sites have frame busting code to break out of the iframe and redirect the top window to their page. I want to use the onbeforeunload event to determine where the webpage is being redirected to. Is there a function that effectively lets me do event.get_redirect_location or something along those lines? Lots of research has led me to the conc
因此,在我的网站上,我在iframe中加载了一个网页,并且一些网站有框架破坏代码来突破iframe并将顶部窗口重定向到他们的页面。 我想使用onbeforeunload事件来确定网页被重定向到的位置。 有没有一个函数可以有效地让我做event.get_redirect_location或沿着这些线? 许多研究让我得出这样的结论:如果window.location从iframe中设置,那么JavaScript无法检查'下一个位置'将会出现的情况并比较两个域。 这是我知道的