发帖到POST ??? [英] Fucntion to POST???

查看:49
本文介绍了发帖到POST ???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我不知道我在做什么 - 我是完全新手来的

Javascript和PHP所以我的代码看起来像垃圾;)


现在我的问题,


我正在尝试用Javascript进行一些测验,但我想通过

沿着varibles到一个php文件(出于某种原因,我有一种感觉

会更容易)


我正在努力收集varibles通过onClick,但我不知道

如何使用onClick加上我找不到任何有用的东西(相当,愚蠢的

足够了)。


我收集了变量后,我想寄给他们到一个php

文件,根据varibles给出报告....任何

sujestions?


如果你我希望看到我的代码位于< a

href =" http://www.kosidesigns.com/quiz"> Quiz< / a>


我知道页面看起来很糟糕,我稍后会修复dat ...


非常感谢提前!!

-Sta12s

解决方案



Sta12s写道:

我正在尝试用Javascript做一个小小的测验但是我想沿着varibles传递到一个php文件(出于某种原因我感觉它会更容易)我正在尝试通过onClick收集变量,但我不知道如何使用onClick。


如果你想继续使用javascript :伪协议:


< a href =" javascript :void(showSection(''business''));"> Y es< / a>

< a href =" javascript :void(showSection(''nonbiz''));"> No< / a>< / p>


它在IE上有一个复杂的问题虽然动画GIF'(即

动画停止点击播放)。你可能想留下那个然后用

代替:

< a href =" ifScriptIsDisabled.html"

onclick =" showSection(''business'',this); return false;">

where" this"将引用链接对象。

*这是可选的* - 如果您稍后决定使用

单击对象(绘制,删除等)执行某些操作。 />

有一种更好,更经常使用(但更难)的方式来了解

通过研究事件对象点击了什么元素。如果你想要冷酷的火鸡学习方法,那就让我们谈谈事件模型和

方法吧。

我收集了变量之后,我想把它们发送到一个php
文件,根据varibles给出一个报告....任何
sujestions?




通过停留在同一页面上或用

服务器响应替换当前页面?


如果是后者那么最好的是有一个表格隐藏的字段

用户选择一步一步填写。

实际上你可以立即使用带有字段集的表单(其中只有一个

fieldset在给定时刻可见) - 而不是DIV'。这将更加简单。


如果您希望在提交表单时保持同一页面,您可以

使用Ajax工具箱:

< http://www.ajaxtoolbox.com>


非常感谢VK!


感恩节很棒!!




Sta12s写道:




你也是,伙计!


: - )


First of all, I have NO idea what I''m doing - I''m a complete newb to
Javascript and PHP so my code is going to look like crap ;)

Now for my problem,

I''m trying to do a little quiz with Javascript but I would like to pass
along the varibles to a php file (for some reason I have a feeling it
would be easier)

I''m trying to gather the varibles through "onClick", but I don''t know
how to use "onClick" PLUS I can''t find anything helpful (rather, dumbed
down enough).

After I have collected the varibles, I would like to send them to a php
file that would give a report based on the varibles .... any
sujestions?

If you would like to see my code it''s located at <a
href="http://www.kosidesigns.com/quiz">Quiz</a>

I know the page looks horrible, I''ll fix dat later ...

Many thanks in advance!!

-Sta12s

解决方案


Sta12s wrote:

I''m trying to do a little quiz with Javascript but I would like to pass
along the varibles to a php file (for some reason I have a feeling it
would be easier)
I''m trying to gather the varibles through "onClick", but I don''t know
how to use "onClick"
If you want to keep using javascript: pseudo-protocol:

<a href="javascript:void(showSection(''business''));">Y es</a>
<a href="javascript:void(showSection(''nonbiz''));">No</a></p>

It has a complication on IE with animated GIF''s though (namely
animation stop playing on click). You may want to leave that then and
use instead:
<a href="IfScriptIsDisabled.html"
onclick="showSection(''business'',this);return false;">
where "this" will refer to the link object.
*this is optional* - if you decide later to do something with the
clicked object (paint it, remove etc.)

There is a better and more often used (but more difficult) way to know
what element has been clicked by studying the event object. If you want
the cold turkey learning method, let''s talk about event model and
methods.
After I have collected the varibles, I would like to send them to a php
file that would give a report based on the varibles .... any
sujestions?



By staying on the same page or by replacing the current page with the
server response?

If the latter then the best would be to have a form with hidden fields
to fill step by step with user choices.
Actually you could use right away a form with fieldsets (where only one
fieldset is visible at a given moment) - instead of DIV''s. That would
be even more simple.

If you want to stay on the same page upon the form submission you can
use Ajax Toolbox:
<http://www.ajaxtoolbox.com>


Thanks so much VK!!!

Have a great thanksgiving!!



Sta12s wrote:

Have a great thanksgiving!!



You too, man!

:-)


这篇关于发帖到POST ???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆