我有一个带有onClick的提交按钮:
<div id="messageDiv">
<form>
<textarea name="message" rows="10" cols="20"></textarea></textarea>
<br /><br />
<input type="submit" value="Send" onClick="sendmail()">
<input type="reset" value="Reset" name='reset'>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
然后我有我的sendmail:
function sendmail()
{
window.location.href = "http://www.rainbowcode.net/index.php/profiles/mail?="+mailid;
window.location('http://www.rainbowcode.net/index.php/profiles/mail?='+mailid);
//return true;
}
Run Code Online (Sandbox Code Playgroud)
mailid是一个全局变量,它在另一个JS函数中设置,它确实包含正确的值.怎么window.location不打开我的页面?
如果我用mailid手动打开它可以正常工作..
我在foreach中有这个代码,列出了唯一代码链接:
<a id="<?php echo $id_to ?>" href="<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this); return false;" >
<?php echo $uniqueCode1?><span class="pink_text"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?>
</a>
<form id="message_area" style="display:none" method="post" action="<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>">
<textarea name="message" rows="10" cols="20"></textarea>
<input name="Submit" type="submit" value="Send"></input>
</form>
Run Code Online (Sandbox Code Playgroud)
这是我查看页面源时得到的结果:
<a href="http://www-rainbowcode-mobi/messageSent.php?id=36" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this); return false;" >
KUZELJA<span class="pink_text">000</span>RC
</a>
<form id="message_area" style="display:none" method="post" action="http://www-rainbowcode-mobi/messageSent.php?id=36">
<textarea name="message" rows="10" cols="20"></textarea>
<input name="Submit" type="submit" value="Send"></input>
</form>
<a href="http://www-rainbowcode-mobi/messageSent.php?id=38" class="charcoal_link" style="line-height: …Run Code Online (Sandbox Code Playgroud) 在我看来,我有这个:
<%--
The training module list
--%>
<div id="training-mod-list-<%: categoryName.Replace(' ', '-') %>" class="training-module-list">
<% foreach (var module in categoryGroup)
{ %>
<div class="training-module-row">
<div class="training-module-name-<%: module.TrainingModuleId %>">
<script type="text/javascript">
<%: Html.GetQTip(module.TrainingModuleId, "", "", QTipPosition.Right,true,""); %> //get error here it has some invalid arguments?
</script>
<%: module.TrainingModuleName %>
</div>
</div>
<% } %>
Run Code Online (Sandbox Code Playgroud)
当我将鼠标悬停在每个培训模块名称上时,我想要一个QTip来显示.
然后GetQtip:
public static MvcHtmlString GetQTip(this HtmlHelper htmlHelper, string propertyName, string message, string propertyNameOverride = "", QTipPosition position = QTipPosition.Right, bool includeEvents = true, string title = …Run Code Online (Sandbox Code Playgroud) 我正在努力设置代码覆盖率.我该怎么办,如何设置,以便我可以得到报道地图/报告?
我有一个运行的单元测试.我必须检查哪些复选框:构建后操作?我必须安装一个插件吗?单元测试在php 5.3.2中,我运行symfony 1.4.5
在cibuild脚本中我运行:
php "test/unit/RbcTest.php"
Run Code Online (Sandbox Code Playgroud)
这里是实际的测试代码:
<?php
require_once dirname(__FILE__).'/../bootstrap/unit.php';
require_once 'PHP/CodeCoverage/Autoload.php';
set_include_path ('phoenix/lib/');
$coverage = new PHP_CodeCoverage;
$coverage->start('strtolowerTest.php');
$coverage->stop();
$writer = new PHP_CodeCoverage_Report_Clover;
$writer->process($coverage, 'phoenix/test/clover.xml');
$writer = new PHP_CodeCoverage_Report_HTML;
$writer->process($coverage, 'phoenix/test/code-coverage-report');
?>
<?php //strtolowerTest.php
echo "1. for strlower";
require_once 'phoenix/lib/vendor/symfony/lib/vendor/lime/lime.php';
echo "2. for strlower";
require_once 'phoenix/lib/validator/myValidatorString.class.php';
echo "3. for strlower";
require_once 'phoenix/lib/vendor/symfony/lib/validator/sfValidatorString.class.php';
$t = new lime_test(2, new lime_output_color());
$t->is(myValidatorString::doCleanEmail('blabla-32.mtmail..com'), 'blabla@mtmail.com');
$t->is(myValidatorString::doClean('@#*+??%^!~blabla-===32.mtmail..com'), 'blabla@mtmail.com');
$t->is(myValidatorString::slugify('sensio labs'), 'sensio-labs');
$t->is(myValidatorString::slugify('paris,france'), 'paris-france');
$t->is(myValidatorString::slugify(' sensio'), 'sensio');
$t->is(myValidatorString::slugify('sensio '), 'sensio');
$t->is(myValidatorString::slugify(''), 'n-a', '::slugify() converts the …Run Code Online (Sandbox Code Playgroud) 我有这个代码:
<div id="messageDiv">
<form>
<textarea name="message" rows="10" cols="20" id="message"></textarea></textarea>
<br /><br />
<input type="submit" value="Send" onClick="return sendmail()">
<input type="reset" value="Reset" name='reset'>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
然后我有我的JS:
function sendmail()
{
var mail = document.getElementById('message').value;
window.location.href = "http://www.rainbowcode.net/apps_dev.php/profiles/mail?id="+mailid;
return false;
}
Run Code Online (Sandbox Code Playgroud)
当我alert(mail)得到正确的值,但当我通过window.location.href到达我的新页面时,我想访问该值...我的表单是一个"帖子",当我做一个print_r($_POST['message'])我得到一个空数组..请帮助?
我正在遵循symblog symfony2教程的第5部分:
http://tutorial.symblog.co.uk/docs/customising-the-view-more-with-twig.html
Run Code Online (Sandbox Code Playgroud)
标题下:主页 - 博客和评论
当我得到更新时:
// src/Blogger/BlogBundle/Repository/BlogRepositoy.php
public function getLatestBlogs($limit = null)
{
$qb = $this->createQueryBuilder('b')
->select('b, c')
->leftJoin('b.comments', 'c')
->addOrderBy('b.created', 'DESC');
if (false === is_null($limit))
$qb->setMaxResults($limit);
return $qb->getQuery()
->getResult();
}
Run Code Online (Sandbox Code Playgroud)
当我更新时:
{# src/Blogger/BlogBundle/Resources/views/Page/index.html.twig #}
{# .. #}
<footer class="meta">
<p>Comments: <a href="{{ path('BloggerBlogBundle_blog_show', { 'id': blog.id }) }}#comments">{{ blog.comments|length }}</a></p>
<p>Posted by <span class="highlight">{{ blog.author }}</span> at {{ blog.created|date('h:iA') }}</p>
<p>Tags: <span class="highlight">{{ blog.tags }}</span></p>
</footer>
{# .. #}
Run Code Online (Sandbox Code Playgroud)
我然后刷新我的浏览器并得到错误:
[Semantical Error] line 0, col 71 near …Run Code Online (Sandbox Code Playgroud) 我有一个scorm模块,它在我的js文件中的window.open中的resizable = 1的新窗口中启动:
function OpenScormModuleWindow(scormModuleId, scormModuleUrl, title, width, height)
{
_scormModuleId = scormModuleId;
InitializeUserScormModule();
scormModuleWindow = window.open(scormModuleUrl, "title", "width=" + width + ", height=" + height + ", resizable = 1");
scormModuleWindow.focus();
}
Run Code Online (Sandbox Code Playgroud)
在我看来,我有:
var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number')
{
myWidth = window.innerWidth;
myHeight = window.innerHeight;
}
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
{
myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
}
else if (document.body && (document.body.clientWidth || document.body.clientHeight))
{
myWidth = document.body.clientWidth; …Run Code Online (Sandbox Code Playgroud) 我有以下内容:
mysql> show create table rc_profile_table \G;
*************************** 1. row ***************************
Table: rc_profile_table
Create Table: CREATE TABLE `rc_profile_table` (
`id` int(11) NOT NULL auto_increment,
`created_at` datetime default NULL,
`name` varchar(32) NOT NULL,
`surname` varchar(32) NOT NULL,
`password` varchar(128) NOT NULL,
`unique_code` varchar(16) NOT NULL,
`msisdn` varchar(32) NOT NULL,
`current_location` varchar(64) NOT NULL,
`profile_pic` varchar(255) default NULL,
`email` varchar(128) NOT NULL,
`age` int(11) NOT NULL,
`city_of_birth` varchar(64) NOT NULL,
`personality` varchar(128) NOT NULL,
`country_id` int(11) NOT NULL,
`religious_id` int(11) NOT NULL, …Run Code Online (Sandbox Code Playgroud) 我有这一行,如何附加带有变量的文本来组成标题?
StringBuilder sb = new StringBuilder();
week6 = model.SelectedSunday.AddDays(-7);
week5 = week6.AddDays(-7);
week4 = week5.AddDays(-7);
week3 = week4.AddDays(-7);
week2 = week3.AddDays(-7);
week1 = week2.AddDays(-7);
sb.AppendLine("Title, Total, " week6, week5, week4, week3, week2, week1 );
Run Code Online (Sandbox Code Playgroud)
还有这段代码:
var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
var jobSortedReportData = _reportingService.GetTradeUKKPIJobSorted(model.SelectedSunday);
foreach (var item in tradesmenReportData)
{
sb.AppendLine(String.Concat("\"", item.Title, "\", item.Total, "\", item.Week6, "\", ", item.Week5, "\", ", item.Week4, "\", ", item.Week3, "\", ", item.Week2, "\", ", item.Week1));
}
Run Code Online (Sandbox Code Playgroud)
在输出文件(excel)中,值后面附加了一个“?在上面一行的某个地方有一个额外的”。我哪里出错了?
谢谢
我在view.aspx中有这一行我没有使用剃须刀:
<p style="color:Red">
<% Html.DropDownListFor(model => model.AllSundays, new SelectList(Model.AllSundays)); %>
</p>
Run Code Online (Sandbox Code Playgroud)
当我运行我的程序并查看源代码时,没有任何内容.我在我的行动中使用了ViewModel:
var allSundaysInThisMonth = new SundaysInMonthViewModel
{
AllSundays = sundays.Select(x => new SelectListItem
{
Value = x.ToString("dd-MM-yyyy"),
Text = x.ToString("dd-MM-yyyy"),
})
};
var selectedSunday = new SundaysInMonthViewModel{
SelectedSunday = thisMonthSundays.Where(x => x < now)
.Last().ToString("dd-MM-yyyy")
};
return View(allSundaysInThisMonth);
Run Code Online (Sandbox Code Playgroud)
谢谢
我有一个带有功能的余烬控制器.在这个函数中,我想打开一个新选项卡.这是我的代码:
App.ActivityController = Em.ObjectController.extend({
actions: {
downloadOfflineOrderSpreadsheet: function() { this.downloadOfflineOrderSpreadsheets(); },
}
downloadOfflineOrderSpreadsheets: function() {
//here go to a new tab please??
}
}
Run Code Online (Sandbox Code Playgroud)
这是我第一次遇到灰烬,所以不知道多少.
我想提取当月的所有星期日,并拥有以下代码:
private string GetDatesOfSundays(DateTime DatMonth)
{
string sReturn = "";
int iDayOffset = DatMonth.Day - 1;
DatMonth = DatMonth.AddDays(System.Convert.ToDouble(-DatMonth.Day + 1));
DateTime DatMonth2 = DatMonth.AddMonths(1).AddDays(System.Convert.ToDouble(-1));
while (DatMonth < DatMonth2)
{
if (DatMonth.DayOfWeek == System.DayOfWeek.Sunday)
{
if (sReturn.Length > 0) sReturn += ",";
sReturn += DatMonth.ToShortDateString();
}
DatMonth = DatMonth.AddDays(1.0);
}
return sReturn;
}
[HttpGet]
public ActionResult TradeUKKPISearchesData()
{
string allSundaysInMonth = GetDatesOfSundays(System.DateTime.Now);
//var reportData = _reportingService.GetTradeUKKPISearches();
//return View(reportData);
}
Run Code Online (Sandbox Code Playgroud)
问题在于我的所有类型字符串for allSundaysInMonth,也是空的.sReturn是字符串类型,但我再次传递一个日期(我知道:))但是allSundaysInMonth应该是什么类型?sReturn确实有正确的日期...我需要在控制器视图的下拉列表中显示这些日期,以便用户可以选择他/她需要为其运行报告的任何星期日.
谢谢
javascript ×4
php ×4
html ×3
asp.net-mvc ×2
c# ×2
doctrine-orm ×1
ember.js ×1
innodb ×1
jenkins ×1
mysql ×1
qtip ×1
symfony ×1
symfony1 ×1