|
I Do Has Some Work been Done.
I've try the HTML-DOM,JSON-Parse. The performance is Very Slow(100 RepeatData in 4 Sec).
Then I've Try the XML-Xslt Translate in client Side.
But I can't Use the Content in side a HTML File.
Is There Any Idea,Can Make Html content like bolow,
translate to a xsl object.
<head runat="server">
<title>TEST</title>
<style type="text/css">
.style1
{
width: 800px;
border-collapse: collapse;
}
.style2
{
width: 337px;
}
</style>
<script type="text/javascript">
function loadXMLDoc(dname) {
if (window.ActiveXObject) {
xhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
}
else {
xhttp = new XMLHttpRequest();
}
xhttp.open("GET", dname, false);
xhttp.send("");
return xhttp.responseText;
}
function StringtoXML(text) {
if (window.ActiveXObject) {
var doc = new ActiveXObject('Microsoft.XMLDOM');
doc.async = 'false';
doc.loadXML(text);
} else {
var parser = new DOMParser();
var doc = parser.parseFromString(text, 'text/xml');
}
return doc;
}
function Write(input1) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.CreateTextFile("C:\\test.txt", true);
s.WriteLine(input1);
s.Close();
}
function displayResult() {
xmlH = loadXMLDoc("DataProvider.aspx");
xml = StringtoXML(xmlH);
el = document.getElementById("form1");
el.removeChild(document.getElementsByTagName("div")[0]);
xslH = document.getElementById("form1").innerHTML.toLowerCase();
alert($("#form1").html());
var el = (document.getElementById("form1"));
xslH = "<?xml version=\"1.0\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n<xsl:template match=\"NewDataSet\">\n" + xslH;
xslH += "\n</xsl:template>\n</xsl:stylesheet>"
xslH = xslH.replace(/XSL/ig, "xsl")
.replace(/VALUE-OF/ig, "value-of")
.replace(/FOR-EACH/ig, "for-each")
.replace(/newdataset/ig, "NewDataSet");
xsl = StringtoXML(xslH);
if (window.ActiveXObject) {
ex = xml.transformNode(xsl);
document.getElementsByTagName("form").innerHTML = ex;
}
else if (document.implementation && document.implementation.createDocument) {
xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xsl);
resultDocument = xsltProcessor.transformToFragment(xml, document);
document.getElementById("example").appendChild(resultDocument);
}
}
function getRightInnerHTML(elm) {
var content = elm.innerHTML;
if (!document.all) return content;
var regOne = /(\s+\w+)\s*=\s*([^<>"\s]+)(?=[^<>]*\/>)/ig; var regTwo = /"'([^'"]*)'"/ig;
content = content.replace(regOne, '$1="$2"').replace(regTwo, '\"$1\"');
var okText = content.replace(/<(\/?)(\w+)([^>]*)>/g, function(match, $1, $2, $3) {
if ($1) { return "</" + $2.toLowerCase() + ">"; }
return ("<" + $2.toLowerCase() + $3 + ">").replace(/=(("[^"]*?")|('[^']*?')|([\w\-\.]+))([\s>])/g,
function(match2, $1, $2, $3, $4, $5, position, all) {
if ($4) {
return '="' + $4 + '"' + $5;
} return match2;
});
});
okText = okText.replace(/<\/?([^>]+)>/g, function(lele) { return lele; })
return okText.replace(/VALUE-OF/ig,"value-of"); }
</script>
</head>
<body onload="displayResult();">
<form id="form1" runat="server">
<div>
<table cellpadding="0">
<tr>
<td>
傳票編號</td>
<td>
傳票日期</td>
</tr>
<tr>
<td>
<xsl:value-of select="帳款模組/帳款編號" /></td>
<td>
<xsl:value-of select="帳款模組/填寫日期" /></td>
</tr>
</table>
<table cellpadding="0" class="style1">
<tbody>
<xsl:for-each select="帳款模組明細">
<tr>
<td><xsl:value-of select="主目" /></td>
<td><xsl:value-of select="子目" /></td>
<td><xsl:value-of select="科目名稱" /></td>
<td><xsl:value-of select="摘要" /></td>
<td><xsl:value-of select="借方金額" /></td>
<td><xsl:value-of select="貸方金額" /></td>
<td><xsl:value-of select="部門編號" /></td>
<td><xsl:value-of select="部門名稱" /></td>
<td><xsl:value-of select="廠商物件類別" /></td>
<td><xsl:value-of select="廠商編號" /></td>
<td><xsl:value-of select="廠商名稱" /></td>
<td><xsl:value-of select="工程案號" /></td>
<td><xsl:value-of select="外部物件主編號" /></td>
<td><xsl:value-of select="外部物件子編號" /></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</form>
<div id="example"></div>
</body>
</html>
|
|
|
|
|
Hi,
Have a look at this page:
http://www.xoompage.com/ticket?id=034abd84-47fd-11e3-bea0-782bcb3e3838[^]
you'll see the value returned is string(1) "" but it's actually a bit value from MySQL and I am using this to read it:
SELECT * FROM support_ticket_messages WHERE support_ticket_id = param_ticket_id ORDER BY support_ticket_message_id DESC;
I am getting the correct value when running it on my localhost and I am also getting the correct value when running the stored procedure on the database.
Then why the PHP is not showing it when I try:
if ($is_support_reply)
{
echo "<div style='background-color: #eee9e9; padding: 10px;'>";
echo "XoomPage Replies :<br><br>";
}
or
if ($mysql_row["is_support_reply"])
{
echo "<div style='background-color: #eee9e9; padding: 10px;'>";
echo "XoomPage Replies :<br><br>";
}
Please help..
Thanks[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
can anyone suggest a free tool for PHP to manage ad rotation and provide a report for banners to the clients?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
I am working on a page that allows a user some control over layout and formatting. I want the user to be able to align the heading of a page just like the Windows Forms ContentAlignment property.
For example: TopLeft, MiddleLeft, BottomLeft, MiddleTop, and so on.
Thanks,
Mark
|
|
|
|
|
And your question is?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I'm not sure what you want. Let me guess. If what you want is web page styling, then that is this web styling language called Cascading Style Sheet or CSS in short. If you want user control over elements on a web page, then you can look to HTML5. If you want more dynamic contents then jQuery is what you are looking for. You can get some good tutorials at the W3C site.
|
|
|
|
|
Sorry for the ambiguity. Windows has a ContentAlignment property that aligns the text in a control from TopLeft to BottomRight, and also middles. I know that using CSS you can align textual content using the div as a container.
I was wondering if there is a way to use the ContentAligment property values from a Windows form to set the div container css. So if the user selects MiddleLeft the text is aligned that way in the html markup.
Mark
|
|
|
|
|
|
Thanks for the link. I used a label control for the heading. That way I could change the alignment and the font. Works fine.
|
|
|
|
|
Hi,
I have a field called is_closed in MySQL table. It's a bit datatype which means it's 0 or 1
I want to know how to deal with it in PHP, like how can I (IF) it?
and is there any way to deal with it as if (is_closed == true)?
Thanks
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Is an ActiveX control that I include in my web application allowed by the browser to contact and download info from sites other than the one hosting my web application?
I understand that JavaScript is barred from contacting third-party sites, but is the ActiveX control also barred?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Yes, ActiveX control also barred by 3rd party website.
|
|
|
|
|
Hi,
I am trying to insert email_header from include file but it's not inserting anything. How can I fix it please?
here is my file:
include 'includes/email_header.php';
$body .= "<h1>Dear Customer</h1><br>";
$body .= "<p>this is a test email.</p>";
$body = nl2br($body);
and this is the email_header.php:
$body = "hello.......";
$body .= "<br>";
$body .= "here is website logo";
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
Why I am getting the above error! it's making me crazy!
the url shown for this error on chrome is memberhome.php
I am not getting this error on my localhost but only getting it when I upload my website to the host
here is the code for it:
include 'includes/php_header.php';
require 'includes/connect2db.php';
if (!isset($_SESSION["member_loggedOn"])) { exit(header("Location: signin")); }
$mysql_command = "CALL sp_get_member_personal_information(:param_member_guid)";
$mysql_query = $mysql_connection->prepare($mysql_command);
$mysql_query->bindParam(':param_member_guid', $_SESSION["member_guid"], PDO::PARAM_STR);
$mysql_query->execute();
$mysql_row_count = $mysql_query->rowCount();
if ($mysql_row_count <= 0) { exit(header("Location: signin")); }
while ($mysql_row = $mysql_query->fetch())
{
$member_title = $mysql_row["member_title_name"];
$member_full_name = $mysql_row["first_name"] . ' ' . $mysql_row["middle_name"] . ' ' . $mysql_row["last_name"];
$member_brief_introduction = $mysql_row["brief_introduction"];
}
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
I see in your code a redirection to signin in case of errors. It is possible that that rediretion brings you back to this page? (You may not see it on development machine, because you get no errors...)
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
signin page has the following only:
if (isset($_SESSION["member_loggedOn"])) { exit(header("Location: member")); }
actually i noticed that thatraja is right. The site is showing properly on IE and safari but not on Chrome.
I asked my host to check..
I have one more question please.. why it;s not showing the exact error, file and line? is it possible to enable it to show such information on host?
Technology News @ www.JassimRahma.com
|
|
|
|
|
It's a client side error raised by the browser. It has no idea about code lines in your server side...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
Hi,
I would like how to add a customer url include in php.
I tried the following but didn't work:
include $_SESSION["domain_name"] . 'includes/php_footer.php';
Technology News @ www.JassimRahma.com
|
|
|
|
|
You didn't share complete code-block. And saying "didn't work' won't help us to spot the issue. Hereafter give us complete details.
I think you're trying to include the dynamic file based on the session value. Check this post.
Dynamic inclusion in PHP[^]
FYI PHP include statement[^]
|
|
|
|
|
Hi everyone,
I am working on a project where I need to come up with a way to gather the end user's computer information to be used for IT purposes, all users will be on a intranet with no exposure to external users.
What is the best way to do this? I've seen mention in a few places to use Java or WBF Browser application.
Any tips/advice would be greatly appreciated.
For additional information, the type of data i need to pull is: domain\username, computer name, serial number to start.
Thanks again
- I changed one line of code and got 99 errors...
|
|
|
|
|
I've got a theme running on my wordpress site
that's powered by ajax and jquery and I've got
an issue with one of my posts where every
time I navigate around the website to that
particular post, it fails to load my thumbnails
in that post correctly unless I reload the page
manually in my browser or when I only type in
the post's url in my browser and then load on
its own without going through the main site
(ajax powered).
I would like to disable Ajax loading for just that
post/link and not the entire website. My
theme has a custom field for javascript and
jquery codes which requires the tag, if I'm
going to paste any codes in this field, there
should be a way to specify a link/url that
doesn't ajax-load right?
I already tried using some custom field
shortcode plugin to invoke a javascript page
refresh in the post but that didn't work until I
manually reloaded the post in my browser then
the shortcode was called and the post auto-
refreshed once.
I found somewhere that using this -> data-
ajax="false" in my page will work but I don't
know where or how to place it in that specific
post.
Is there a way I could add some ajax-
compatible code to my post that will reload
the page ONCE automatically when it has been
loaded?
-- modified 3-Nov-13 13:46pm.
|
|
|
|
|
Hi,
I have the following in my meta.php include file:
<meta name="DC.title" content="MyWebSiteName" />
it's the same for all except few file where I will have:
<meta name="DC.title" content="MemberName" />
is it possible to keep the:
<meta name="DC.title" content="XoomPage" />
in the meta.php include file but override it with:
<meta name="DC.title" content="XoomPage" />
in other specific pages?
How?
Technology News @ www.JassimRahma.com
|
|
|
|
|
Hi,
I have a PHP project. I want to know what's the best way to save the date for a post in MySQL so it can be shown in a local time of the user.
For example if the local time in 00:00 in UAE and it's 09:99 in USA and a user in based in UAE created a post it will show created in 00:00 but if a user based in USA viewed the same post it will show created in 09:00
I am not sure how to explain this more but hope it's clear..
Thanks
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Always (and I do mean always) store dates and times as UTC values. Only when you need to display them should you apply the local time zone offset of the user's system. How you do this depends on your application and language, and making the effort to do a little research for yourself would quickly lead you to http://www.w3schools.com/php/func_date_localtime.asp[^].
Veni, vidi, abiit domum
|
|
|
|